@@ -1539,16 +1539,20 @@ public UserAccount updateUser(UpdateUserCmd updateUserCmd) {
1539
1539
public void verifyCallerPrivilegeForUserOrAccountOperations (Account userAccount ) {
1540
1540
s_logger .debug (String .format ("Verifying whether the caller has the correct privileges based on the user's role type and API permissions: %s" , userAccount ));
1541
1541
1542
- checkCallerRoleTypeAllowedForUserOrAccountOperations (userAccount , null );
1543
- checkCallerApiPermissionsForUserOrAccountOperations (userAccount );
1542
+ if (!Account .Type .PROJECT .equals (userAccount .getType ())) {
1543
+ checkCallerRoleTypeAllowedForUserOrAccountOperations (userAccount , null );
1544
+ checkCallerApiPermissionsForUserOrAccountOperations (userAccount );
1545
+ }
1544
1546
}
1545
1547
1546
1548
protected void verifyCallerPrivilegeForUserOrAccountOperations (User user ) {
1547
1549
s_logger .debug (String .format ("Verifying whether the caller has the correct privileges based on the user's role type and API permissions: %s" , user ));
1548
1550
1549
1551
Account userAccount = getAccount (user .getAccountId ());
1550
- checkCallerRoleTypeAllowedForUserOrAccountOperations (userAccount , user );
1551
- checkCallerApiPermissionsForUserOrAccountOperations (userAccount );
1552
+ if (!Account .Type .PROJECT .equals (userAccount .getType ())) {
1553
+ checkCallerRoleTypeAllowedForUserOrAccountOperations (userAccount , user );
1554
+ checkCallerApiPermissionsForUserOrAccountOperations (userAccount );
1555
+ }
1552
1556
}
1553
1557
1554
1558
protected void checkCallerRoleTypeAllowedForUserOrAccountOperations (Account userAccount , User user ) {
@@ -2626,10 +2630,8 @@ public AccountVO createAccount(final String accountName, final Account.Type acco
2626
2630
}
2627
2631
}
2628
2632
2629
- if (!Account .Type .PROJECT .equals (accountType )) {
2630
- AccountVO newAccount = new AccountVO (accountName , domainId , networkDomain , accountType , roleId , uuid );
2631
- verifyCallerPrivilegeForUserOrAccountOperations (newAccount );
2632
- }
2633
+ AccountVO newAccount = new AccountVO (accountName , domainId , networkDomain , accountType , roleId , uuid );
2634
+ verifyCallerPrivilegeForUserOrAccountOperations (newAccount );
2633
2635
2634
2636
// Create the account
2635
2637
return Transaction .execute (new TransactionCallback <AccountVO >() {
0 commit comments