Add #absentUser() to ForProject, ForRef and ForChange
We used to think adding this method to the top level is enough and could avoid misuses. But it turns out we still need them in other permission backend classes so that we only need to rescope a user when necessary, which could provide better performance. See I67b72b59 as an example. Change-Id: I9ef30fb38315250fa63fb8b3d27e19e19d5e3e22
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.server.permissions;
|
||||
|
||||
import com.google.gerrit.extensions.api.access.GlobalOrPluginPermission;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
@@ -128,6 +129,11 @@ public class FailedPermissionBackend {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForProject absentUser(Account.Id id) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resourcePath() {
|
||||
throw new UnsupportedOperationException(
|
||||
@@ -181,6 +187,11 @@ public class FailedPermissionBackend {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForRef absentUser(Account.Id id) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resourcePath() {
|
||||
throw new UnsupportedOperationException(
|
||||
@@ -233,6 +244,11 @@ public class FailedPermissionBackend {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForChange absentUser(Account.Id id) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resourcePath() {
|
||||
throw new UnsupportedOperationException(
|
||||
|
||||
Reference in New Issue
Block a user