mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-31 06:28:13 +02:00
"Create Application" button in OAuth Server application should be greyed out if user does not have correct capabilities.
Summary: Fixes T7497, "Create Application" button in Oauth Server application should be greyed out if user does not have correct capabilities and should open a "You Shall Not Pass" modal. Test Plan: Login as non-admin, open OAuth Server application, "Create Application" button should be greyed out, and clicking it should open a modal dialog over the list view without navigating away from it. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7497 Differential Revision: https://secure.phabricator.com/D12560
This commit is contained in:
parent
80acaf6831
commit
3f77ad9368
1 changed files with 5 additions and 0 deletions
|
@ -25,10 +25,15 @@ final class PhabricatorOAuthClientListController
|
||||||
protected function buildApplicationCrumbs() {
|
protected function buildApplicationCrumbs() {
|
||||||
$crumbs = parent::buildApplicationCrumbs();
|
$crumbs = parent::buildApplicationCrumbs();
|
||||||
|
|
||||||
|
$can_create = $this->hasApplicationCapability(
|
||||||
|
PhabricatorOAuthServerCreateClientsCapability::CAPABILITY);
|
||||||
|
|
||||||
$crumbs->addAction(
|
$crumbs->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
->setHref($this->getApplicationURI('client/create/'))
|
->setHref($this->getApplicationURI('client/create/'))
|
||||||
->setName(pht('Create Application'))
|
->setName(pht('Create Application'))
|
||||||
|
->setDisabled(!$can_create)
|
||||||
|
->setWorkflow(!$can_create)
|
||||||
->setIcon('fa-plus-square'));
|
->setIcon('fa-plus-square'));
|
||||||
|
|
||||||
return $crumbs;
|
return $crumbs;
|
||||||
|
|
Loading…
Add table
Reference in a new issue