Package org.apache.cloudstack.api.response.iam

Examples of org.apache.cloudstack.api.response.iam.IAMPermissionResponse


        ListResponse<IAMPolicyResponse> policyResp = _aclSrv.listIAMPolicies(null, "policy1", callerDomainId, 0L, 20L);
        assertTrue("No. of response items should be one", policyResp.getCount() == 1);
        IAMPolicyResponse resp = policyResp.getResponses().get(0);
        Set<IAMPermissionResponse> permList = resp.getPermissionList();
        assertTrue("Permission list should not be empty", permList != null && permList.size() > 0);
        IAMPermissionResponse permResp = permList.iterator().next();
        assertEquals("There should be one permission for listVirtualMachines", "listVirtualMachines", permResp.getAction());

        //remove permission from policy
        policyPerms.remove(perm);
        _aclSrv.removeIAMPermissionFromIAMPolicy(policyId, VirtualMachine.class.getSimpleName(),
                PermissionScope.RESOURCE, resId, "listVirtualMachines");
View Full Code Here


        }
        // find permissions associated with this policy
        List<IAMPolicyPermission> permissions = _iamSrv.listPolicyPermissions(policy.getId());
        if (permissions != null && permissions.size() > 0) {
            for (IAMPolicyPermission permission : permissions) {
                IAMPermissionResponse perm = new IAMPermissionResponse();
                perm.setAction(permission.getAction());
                if (permission.getEntityType() != null) {
                    perm.setEntityType(permission.getEntityType());
                }
                if (permission.getScope() != null) {
                    perm.setScope(PermissionScope.valueOf(permission.getScope()));
                }
                perm.setScopeId(permission.getScopeId());
                perm.setPermission(permission.getPermission());
                response.addPermission(perm);
            }
        }
        response.setObjectName("aclpolicy");
        return response;
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.response.iam.IAMPermissionResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.