PutAssignee: use #absentUser to check permission for the input assignee

Change-Id: Ib7ac8b14153dcd1e51bba7695fb34849410219f8
This commit is contained in:
Changcheng Xiao
2018-07-05 13:55:52 +02:00
parent f27daa0864
commit 1e5636aeae

View File

@@ -89,7 +89,10 @@ public class PutAssignee extends RetryingRestModifyView<ChangeResource, Assignee
throw new UnprocessableEntityException(input.assignee + " is not active");
}
try {
rsrc.permissions().database(db).user(assignee).check(ChangePermission.READ);
rsrc.permissions()
.database(db)
.absentUser(assignee.getAccountId())
.check(ChangePermission.READ);
} catch (AuthException e) {
throw new AuthException("read not permitted for " + input.assignee);
}