1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

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:
epriestley 2015-06-16 08:53:28 -07:00
parent c2a2933848
commit c9be5fef27

View file

@ -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,
);