cleanup of redundant check for sameOwner (#4110)

Entity ownership is already being verified at line 508.
This commit is contained in:
Lucas Asth 2020-05-30 08:33:39 -03:00 committed by GitHub
parent d0d346524b
commit 630d826ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,7 +507,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
ControlledEntity prevEntity = null;
if (sameOwner) {
for (ControlledEntity entity : entities) {
if (sameOwner) {
if (ownerId == null) {
ownerId = entity.getAccountId();
} else if (ownerId.longValue() != entity.getAccountId()) {
@ -516,7 +515,6 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M
prevEntity = entity;
}
}
}
if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || isRootAdmin(caller.getId())) {
// no need to make permission checks if the system/root admin makes the call