1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

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
This commit is contained in:
lkassianik 2015-04-26 12:17:25 -07:00 committed by epriestley
parent e39c3ef825
commit f347c002a6

View file

@ -134,6 +134,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
->setName(pht('Show Public Key'))
->setIcon('fa-download')
->setHref($this->getApplicationURI("public/{$id}/"))
->setDisabled(!$can_edit)
->setWorkflow(true));
}
@ -142,6 +143,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
->setName($credential_conduit_text)
->setIcon($credential_conduit_icon)
->setHref($this->getApplicationURI("conduit/{$id}/"))
->setDisabled(!$can_edit)
->setWorkflow(true));
$actions->addAction(
@ -149,7 +151,7 @@ final class PassphraseCredentialViewController extends PassphraseController {
->setName($credential_lock_text)
->setIcon($credential_lock_icon)
->setHref($this->getApplicationURI("lock/{$id}/"))
->setDisabled($is_locked)
->setDisabled(!$can_edit || $is_locked)
->setWorkflow(true));
}