Cleanup callers of PermissionBackend#user()
This commit moves callers of PermissionBackend#user() to call PermissionBackend#currentUser() in cases where the user for the previous call could only come from the Injector and where we don't already need a CurrentUser object in the class. It migrates callers that explicitly check permissions of absent users to call PermissionBackend#absentUser(). In cases where we check permissions of absent users that could also be unauthenticated, checks for anonymous users are made explicitly. Change-Id: I6b470790e89b69077650fed42cb61dfeeb404b6e
This commit is contained in:
@@ -123,7 +123,7 @@ public class EqualsLabelPredicate extends ChangeIndexPredicate {
|
||||
// Check the user has 'READ' permission.
|
||||
try {
|
||||
PermissionBackend.ForChange perm =
|
||||
permissionBackend.user(reviewer).database(dbProvider).change(cd);
|
||||
permissionBackend.absentUser(approver).database(dbProvider).change(cd);
|
||||
ProjectState projectState = projectCache.checkedGet(cd.project());
|
||||
return projectState != null
|
||||
&& projectState.statePermitsRead()
|
||||
|
||||
Reference in New Issue
Block a user