use of org.apache.cloudstack.acl.SecurityChecker.AccessType in project cloudstack by apache.
the class IAMApiServiceImpl method addIAMPermissionToIAMPolicy.
@DB
@Override
@ActionEvent(eventType = EventTypes.EVENT_IAM_POLICY_GRANT, eventDescription = "Granting acl permission to IAM Policy")
public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, PermissionScope scope, Long scopeId, String action, Permission perm, Boolean recursive, Boolean readOnly) {
Class<?> cmdClass = _apiServer.getCmdClass(action);
AccessType accessType = null;
if (BaseListCmd.class.isAssignableFrom(cmdClass)) {
if (readOnly) {
accessType = AccessType.ListEntry;
} else {
accessType = AccessType.UseEntry;
}
} else {
accessType = AccessType.OperateEntry;
}
String accessTypeStr = (accessType != null) ? accessType.toString() : null;
return _iamSrv.addIAMPermissionToIAMPolicy(iamPolicyId, entityType, scope.toString(), scopeId, action, accessTypeStr, perm, recursive);
}
Aggregations