@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Passphrase credentials should correctly grey out disallowed actions.

Summary: Fixes T7493, Credential actions in Passphrase should correclty appear greyed out if clicking them will result in a "You Shall Not Pass" dialog.

Test Plan: Create a credential that is visible to everyone but editable by one, login as a user incapable of editing it, navigate to the credential view, all actions should be greyed out, and all actions should open a "You Shall Not Pass" dialog.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7493

Differential Revision: https://secure.phabricator.com/D12558

authored by

lkassianik and committed by
epriestley
f347c002 e39c3ef8

+3 -1
+3 -1
src/applications/passphrase/controller/PassphraseCredentialViewController.php
··· 134 134 ->setName(pht('Show Public Key')) 135 135 ->setIcon('fa-download') 136 136 ->setHref($this->getApplicationURI("public/{$id}/")) 137 + ->setDisabled(!$can_edit) 137 138 ->setWorkflow(true)); 138 139 } 139 140 ··· 142 143 ->setName($credential_conduit_text) 143 144 ->setIcon($credential_conduit_icon) 144 145 ->setHref($this->getApplicationURI("conduit/{$id}/")) 146 + ->setDisabled(!$can_edit) 145 147 ->setWorkflow(true)); 146 148 147 149 $actions->addAction( ··· 149 151 ->setName($credential_lock_text) 150 152 ->setIcon($credential_lock_icon) 151 153 ->setHref($this->getApplicationURI("lock/{$id}/")) 152 - ->setDisabled($is_locked) 154 + ->setDisabled(!$can_edit || $is_locked) 153 155 ->setWorkflow(true)); 154 156 } 155 157