Improve messaging of special policy rules in applications

Summary: Ref T603. When the user encounters an action which is controlled by a special policy rule in the application, make it easier for applications to show the user what policy controls the action and what the setting is. I took this about halfway before and left a TODO, but turn it into something more useful.

Test Plan: See screenshots.

Reviewers: btrahan, chad

Reviewed By: chad

CC: chad, aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7265
This commit is contained in:
epriestley
2013-10-09 13:52:04 -07:00
parent 45f38c549b
commit 3147a6ca57
6 changed files with 85 additions and 24 deletions

View File

@@ -63,8 +63,14 @@ final class PhabricatorPolicyExplainController
$auto_info = phutil_tag('ul', array(), $auto_info);
}
$capability_name = $capability;
$capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability);
if ($capobj) {
$capability_name = $capobj->getCapabilityName();
}
$content = array(
pht('Users with the "%s" capability:', "Can View"),
pht('Users with the "%s" capability:', $capability_name),
$auto_info,
);