Merge "Make the ability to remove reviewers a grantable permission"
This commit is contained in:
@@ -282,9 +282,10 @@ public class ChangeControl {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The branch owner, project owner, site admin can remove anyone.
|
||||
//
|
||||
if (getRefControl().isOwner() // branch owner
|
||||
// Users with the remove reviewer permission, the branch owner, project
|
||||
// owner and site admin can remove anyone
|
||||
if (getRefControl().canRemoveReviewer() // has removal permissions
|
||||
|| getRefControl().isOwner() // branch owner
|
||||
|| getProjectControl().isOwner() // project owner
|
||||
|| getCurrentUser().getCapabilities().canAdministrateServer()) {
|
||||
return true;
|
||||
|
||||
@@ -322,6 +322,11 @@ public class RefControl {
|
||||
return canPerform(Permission.ABANDON);
|
||||
}
|
||||
|
||||
/** @return true if this user can remove a reviewer for a change. */
|
||||
public boolean canRemoveReviewer() {
|
||||
return canPerform(Permission.REMOVE_REVIEWER);
|
||||
}
|
||||
|
||||
/** All value ranges of any allowed label permission. */
|
||||
public List<PermissionRange> getLabelRanges() {
|
||||
List<PermissionRange> r = new ArrayList<PermissionRange>();
|
||||
|
||||
Reference in New Issue
Block a user