Page MenuHomePhabricator

D11229.diff
No OneTemporary

D11229.diff

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

Mime Type
text/plain
Expires
Fri, Oct 25, 11:55 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715549
Default Alt Text
D11229.diff (1 KB)

Event Timeline