DaanHoogland commented on a change in pull request #5879:
URL: https://github.com/apache/cloudstack/pull/5879#discussion_r788794681



##########
File path: server/src/main/java/com/cloud/user/AccountManagerImpl.java
##########
@@ -1110,6 +1123,31 @@ public UserAccount createUserAccount(final String 
userName, final String passwor
         return _userAccountDao.findById(userId);
     }
 
+    /**
+     * if there is any permission under the requested role that is not 
permitted for the caller, refuse
+     */
+    private void checkRoleEscalation(Account caller, Long requestedRoleId) {
+        List<RolePermission> requestedPermissions = 
roleService.findAllPermissionsBy(requestedRoleId);
+
+        for (RolePermission permission : requestedPermissions) {
+            if (permission.getPermission() == Permission.ALLOW) {
+                String command = permission.getRule().getRuleString();
+                if (command.contains("*")) {
+                    // find all api that match command and loop
+                    checkApiAccess(caller, command);
+                } else {
+                    checkApiAccess(caller, command);
+                }

Review comment:
       :) it will be when done, still in progress @Pearl1594 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to