mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix NPE about accessType in RoleBasedApiAccessChecker.start.
This commit is contained in:
parent
cc66d03f81
commit
b725035b22
@ -28,10 +28,6 @@ import javax.naming.ConfigurationException;
|
|||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import org.apache.cloudstack.acl.APIChecker;
|
|
||||||
import org.apache.cloudstack.acl.AclEntityType;
|
|
||||||
import org.apache.cloudstack.acl.PermissionScope;
|
|
||||||
import org.apache.cloudstack.acl.RoleType;
|
|
||||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||||
import org.apache.cloudstack.api.APICommand;
|
import org.apache.cloudstack.api.APICommand;
|
||||||
import org.apache.cloudstack.api.BaseCmd;
|
import org.apache.cloudstack.api.BaseCmd;
|
||||||
@ -207,11 +203,11 @@ public class RoleBasedAPIAccessChecker extends AdapterBase implements APIChecker
|
|||||||
|
|
||||||
if (entityTypes == null || entityTypes.length == 0) {
|
if (entityTypes == null || entityTypes.length == 0) {
|
||||||
_iamSrv.addAclPermissionToAclPolicy(new Long(role.ordinal()) + 1, null, permissionScope.toString(), new Long(-1),
|
_iamSrv.addAclPermissionToAclPolicy(new Long(role.ordinal()) + 1, null, permissionScope.toString(), new Long(-1),
|
||||||
apiName, accessType.toString(), Permission.Allow);
|
apiName, (accessType == null) ? null : accessType.toString(), Permission.Allow);
|
||||||
} else {
|
} else {
|
||||||
for (AclEntityType entityType : entityTypes) {
|
for (AclEntityType entityType : entityTypes) {
|
||||||
_iamSrv.addAclPermissionToAclPolicy(new Long(role.ordinal()) + 1, entityType.toString(), permissionScope.toString(), new Long(-1),
|
_iamSrv.addAclPermissionToAclPolicy(new Long(role.ordinal()) + 1, entityType.toString(), permissionScope.toString(), new Long(-1),
|
||||||
apiName, accessType.toString(), Permission.Allow);
|
apiName, (accessType == null) ? null : accessType.toString(), Permission.Allow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user