Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14045626
D11229.id26963.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11229.id26963.diff
View Options
diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php
--- a/src/applications/project/query/PhabricatorProjectSearchEngine.php
+++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php
@@ -212,7 +212,12 @@
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
- foreach ($projects as $project) {
+ $can_edit_projects = id(new PhabricatorPolicyFilter())
+ ->setViewer($viewer)
+ ->requireCapabilities(array(PhabricatorPolicyCapability::CAN_EDIT))
+ ->apply($projects);
+
+ foreach ($projects as $key => $project) {
$id = $project->getID();
$workboards_uri = $this->getApplicationURI("board/{$id}/");
$members_uri = $this->getApplicationURI("members/{$id}/");
@@ -223,10 +228,18 @@
),
pht('Workboard'));
- $members_url = phutil_tag(
+ $members_class = null;
+ $members_sigil = null;
+ if (!isset($can_edit_projects[$key])) {
+ $members_class = 'disabled';
+ $members_sigil = 'workflow';
+ }
+ $members_url = javelin_tag(
'a',
array(
'href' => $members_uri,
+ 'class' => $members_class,
+ 'sigil' => $members_sigil,
),
pht('Members'));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 7:35 AM (4 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715549
Default Alt Text
D11229.id26963.diff (1 KB)
Attached To
Mode
D11229: Projects - display "members" link in disabled style if user can't edit project
Attached
Detach File
Event Timeline
Log In to Comment