Skip to content

Commit bf14d8e

Browse files
author
epriestley
committed
Add some more policy strings
Summary: Provides more helpful text, notabl on `bin/policy show`. Test Plan: Ran `bin/policy show`. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7204
1 parent 0d83e1d commit bf14d8e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/applications/policy/filter/PhabricatorPolicy.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,25 @@ public function getExplanation($capability) {
153153
return pht('Other: %s', $this->getName());
154154
}
155155
break;
156+
case PhabricatorPolicyCapability::CAN_EDIT:
157+
switch ($this->getPHID()) {
158+
case PhabricatorPolicies::POLICY_USER:
159+
return pht('Editable by all logged in users.');
160+
case PhabricatorPolicies::POLICY_ADMIN:
161+
return pht('Editable by all administrators.');
162+
case PhabricatorPolicies::POLICY_NOONE:
163+
return pht('Not editable by default.');
164+
}
165+
166+
switch ($this->getType()) {
167+
case PhabricatorPolicyType::TYPE_PROJECT:
168+
return pht(
169+
'Editable by members of the project "%s".',
170+
$this->getName());
171+
case PhabricatorPolicyType::TYPE_MASKED:
172+
return pht('Other: %s', $this->getName());
173+
}
174+
break;
156175
}
157176

158177

0 commit comments

Comments
 (0)