mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01: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:
parent
c2a2933848
commit
c9be5fef27
1 changed files with 20 additions and 0 deletions
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue