Skip to content

Commit 2e5b529

Browse files
author
Prachi Damle
committed
CLOUDSTACK-6560: IAM - Admin user is denied permission to create Egress rule for a user's network
Changes: - CS 4.3 handled Network entity in two ways: a) Specified "UseNetwork" access and did a strict check w.r.t who can use this network. Regular users and Domain Admin went through the strict check. Root admin got access always. b) Specified "null" access and that meant admins can access this network for the calling API that passes null access. - Fixing CS 4.4 IAM to handle this behavior: a) "UseNetwork" is mapped to "UseEntry" and IAM check will be done only for domain admin and regular users when this access is specified. Root Admin is grated access. b) If "null" access is specified, root and domain admin both are granted access. Regular users still go through IAM.
1 parent e89c628 commit 2e5b529

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎server/src/com/cloud/template/TemplateManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ public List<String> listTemplatePermissions(BaseListTemplateOrIsoPermissionsCmd
11331133
}
11341134

11351135
if (!template.isPublicTemplate()) {
1136-
_accountMgr.checkAccess(caller, null, template);
1136+
_accountMgr.checkAccess(caller, AccessType.ListEntry, template);
11371137
}
11381138

11391139
List<String> accountNames = new ArrayList<String>();

‎server/src/com/cloud/user/AccountManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ public void checkAccess(Account caller, AccessType accessType, String apiName, C
497497
&& (accessType == null || accessType == AccessType.UseEntry)) {
498498

499499
for (ControlledEntity entity : entities) {
500-
if (entity instanceof VirtualMachineTemplate || entity instanceof Network
500+
if (entity instanceof VirtualMachineTemplate || (entity instanceof Network && accessType != null && (isDomainAdmin || isResourceDomainAdmin))
501501
|| entity instanceof AffinityGroup || entity instanceof SecurityGroup) {
502502
// Go through IAM (SecurityCheckers)
503503
for (SecurityChecker checker : _securityCheckers) {

0 commit comments

Comments
 (0)