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:
Changcheng Xiao
2018-05-15 16:27:32 +02:00
parent 4501481b2a
commit 2b2a99e538
9 changed files with 85 additions and 11 deletions

View File

@@ -79,8 +79,8 @@ public class DefaultPermissionBackend extends PermissionBackend {
}
@Override
public WithUser absentUser(Account.Id user) {
IdentifiedUser identifiedUser = identifiedUserFactory.create(checkNotNull(user, "user"));
public WithUser absentUser(Account.Id id) {
IdentifiedUser identifiedUser = identifiedUserFactory.create(checkNotNull(id, "user"));
return new WithUserImpl(identifiedUser);
}