Convert runAs to PermissionBackend

Change-Id: Ia08189d864388b45c7f11b41cc835fda57d7e03d
This commit is contained in:
Shawn Pearce
2017-02-19 20:45:19 -08:00
committed by David Pursehouse
parent f4e84de1ae
commit f49c2a87ab
3 changed files with 35 additions and 11 deletions

View File

@@ -112,11 +112,6 @@ public class CapabilityControl {
return canPerform(GlobalCapability.ACCESS_DATABASE);
}
/** @return true if the user can impersonate another user. */
public boolean canRunAs() {
return canPerform(GlobalCapability.RUN_AS);
}
/** @return which priority queue the user's tasks should be submitted to. */
public QueueProvider.QueueType getQueueType() {
// If a non-generic group (that is not Anonymous Users or Registered Users)
@@ -245,8 +240,6 @@ public class CapabilityControl {
return canMaintainServer();
case MODIFY_ACCOUNT:
return canModifyAccount();
case RUN_AS:
return canRunAs();
case VIEW_ALL_ACCOUNTS:
return canViewAllAccounts();
case VIEW_QUEUE:
@@ -265,6 +258,9 @@ public class CapabilityControl {
case VIEW_CONNECTIONS:
case VIEW_PLUGINS:
return canPerform(perm.permissionName()) || canAdministrateServer();
case RUN_AS:
return canPerform(perm.permissionName());
}
throw new PermissionBackendException(perm + " unsupported");
}