Show spaces in policy explanation dialogs
Summary: Ref T8449. When an object is in a space, explain that clearly in the policy description dialog.
Test Plan: {F496126}
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T8449
Differential Revision: https://secure.phabricator.com/D13264
This commit is contained in:
@@ -69,7 +69,27 @@ final class PhabricatorPolicyExplainController
|
||||
$capability_name = $capobj->getCapabilityName();
|
||||
}
|
||||
|
||||
$space_info = null;
|
||||
if ($object instanceof PhabricatorSpacesInterface) {
|
||||
if (PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) {
|
||||
$space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID(
|
||||
$object);
|
||||
|
||||
$handles = $viewer->loadHandles(array($space_phid));
|
||||
|
||||
$space_info = array(
|
||||
pht(
|
||||
'This object is in %s, and can only be seen by users with '.
|
||||
'access to that space.',
|
||||
$handles[$space_phid]->renderLink()),
|
||||
phutil_tag('br'),
|
||||
phutil_tag('br'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$content = array(
|
||||
$space_info,
|
||||
pht('Users with the "%s" capability:', $capability_name),
|
||||
$auto_info,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user