Skip to content

Commit a600ab7

Browse files
author
epriestley
committed
Prevent administrators from locking themselves out of applications
Summary: Ref T603. This could be a nicer UX, but limit the amount of foot-shooting that users can possibly do. You can still manage if you're really tricky ("Members of project X", then leave the project) but this should make it hard to make a mistake. It seems very unlikely any user ever intends to lock themselves out of an application. Test Plan: Set an application's view policy to permissive ("Administrators") and nonpermissive ("No One") values. The former were accepted, the latter rejected. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D7218
1 parent 1a5de83 commit a600ab7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/applications/meta/controller/PhabricatorApplicationEditController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ public function processRequest() {
7575

7676
$value[$phid]['policy'] = $result + $value[$phid]['policy'];
7777

78+
// Don't allow users to make policy edits which would lock them out of
79+
// applications, since they would be unable to undo those actions.
80+
PhabricatorEnv::overrideConfig($key, $value);
81+
PhabricatorPolicyFilter::mustRetainCapability(
82+
$user,
83+
$application,
84+
PhabricatorPolicyCapability::CAN_VIEW);
85+
86+
PhabricatorPolicyFilter::mustRetainCapability(
87+
$user,
88+
$application,
89+
PhabricatorPolicyCapability::CAN_EDIT);
90+
7891
PhabricatorConfigEditor::storeNewValue(
7992
$config_entry,
8093
$value,

0 commit comments

Comments
 (0)