Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15410024
D7310.id16468.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7310.id16468.diff
View Options
Index: src/applications/policy/query/PhabricatorPolicyQuery.php
===================================================================
--- src/applications/policy/query/PhabricatorPolicyQuery.php
+++ src/applications/policy/query/PhabricatorPolicyQuery.php
@@ -147,6 +147,7 @@
->setType(PhabricatorPolicyType::TYPE_GLOBAL)
->setPHID($constant)
->setName(self::getGlobalPolicyName($constant))
+ ->setShortName(self::getGlobalPolicyShortName($constant))
->makeEphemeral();
}
@@ -168,6 +169,15 @@
}
}
+ private static function getGlobalPolicyShortName($policy) {
+ switch ($policy) {
+ case PhabricatorPolicies::POLICY_PUBLIC:
+ return pht('Public');
+ default:
+ return null;
+ }
+ }
+
private function loadObjectPolicyPHIDs() {
$phids = array();
$viewer = $this->getViewer();
Index: src/applications/policy/storage/PhabricatorPolicy.php
===================================================================
--- src/applications/policy/storage/PhabricatorPolicy.php
+++ src/applications/policy/storage/PhabricatorPolicy.php
@@ -8,6 +8,7 @@
const ACTION_DENY = 'deny';
private $name;
+ private $shortName;
private $type;
private $href;
private $icon;
@@ -106,6 +107,18 @@
return $this->name;
}
+ public function setShortName($short_name) {
+ $this->shortName = $short_name;
+ return $this;
+ }
+
+ public function getShortName() {
+ if ($this->shortName) {
+ return $this->shortName;
+ }
+ return $this->getName();
+ }
+
public function setHref($href) {
$this->href = $href;
return $this;
Index: src/view/phui/PHUIHeaderView.php
===================================================================
--- src/view/phui/PHUIHeaderView.php
+++ src/view/phui/PHUIHeaderView.php
@@ -224,7 +224,7 @@
'href' => '/policy/explain/'.$phid.'/'.$view_capability.'/',
'sigil' => 'workflow',
),
- $policy->getName());
+ $policy->getShortName());
return array($icon, $link);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 6:42 AM (6 d, 3 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7579669
Default Alt Text
D7310.id16468.diff (2 KB)
Attached To
Mode
D7310: Render public content as "Public" in headers, not "Public (No Login Required)"
Attached
Detach File
Event Timeline
Log In to Comment