mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
cleanup of redundant check for sameOwner (#4110)
Entity ownership is already being verified at line 508.
This commit is contained in:
parent
d0d346524b
commit
630d826ce0
@ -507,14 +507,12 @@ 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()) {
|
||||
throw new PermissionDeniedException("Entity " + entity + " and entity " + prevEntity + " belong to different accounts");
|
||||
}
|
||||
prevEntity = entity;
|
||||
if (ownerId == null) {
|
||||
ownerId = entity.getAccountId();
|
||||
} else if (ownerId.longValue() != entity.getAccountId()) {
|
||||
throw new PermissionDeniedException("Entity " + entity + " and entity " + prevEntity + " belong to different accounts");
|
||||
}
|
||||
prevEntity = entity;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user