mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
add 'recursive' column to permission table
This commit is contained in:
parent
81323dce5d
commit
ce95f3122b
@ -60,6 +60,9 @@ public class AclPolicyPermissionVO implements AclPolicyPermission {
|
||||
@Column(name = "permission")
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
private Permission permission;
|
||||
|
||||
@Column(name = "recursive")
|
||||
private Boolean recursive;
|
||||
|
||||
@Column(name = GenericDao.REMOVED_COLUMN)
|
||||
private Date removed;
|
||||
@ -72,7 +75,7 @@ public class AclPolicyPermissionVO implements AclPolicyPermission {
|
||||
}
|
||||
|
||||
public AclPolicyPermissionVO(long aclPolicyId, String action, String entityType, String accessType, String scope,
|
||||
Long scopeId, Permission permission) {
|
||||
Long scopeId, Permission permission, Boolean recursive) {
|
||||
this.aclPolicyId = aclPolicyId;
|
||||
this.action = action;
|
||||
this.entityType = entityType;
|
||||
@ -80,6 +83,7 @@ public class AclPolicyPermissionVO implements AclPolicyPermission {
|
||||
this.scope = scope;
|
||||
this.scopeId = scopeId;
|
||||
this.permission = permission;
|
||||
this.recursive = recursive;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -169,4 +173,9 @@ public class AclPolicyPermissionVO implements AclPolicyPermission {
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public Boolean isRecursive() {
|
||||
return recursive;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ public class IAMServiceImpl extends ManagerBase implements IAMService, Manager {
|
||||
AclPolicyPermissionVO permit = _policyPermissionDao.findByPolicyAndEntity(aclPolicyId, entityType, scope, scopeId, action, perm);
|
||||
if (permit == null) {
|
||||
// not there already
|
||||
permit = new AclPolicyPermissionVO(aclPolicyId, action, entityType, accessType, scope, scopeId, perm);
|
||||
permit = new AclPolicyPermissionVO(aclPolicyId, action, entityType, accessType, scope, scopeId, perm, false);
|
||||
_policyPermissionDao.persist(permit);
|
||||
}
|
||||
return policy;
|
||||
|
||||
@ -522,6 +522,7 @@ CREATE TABLE `cloud`.`acl_policy_permission` (
|
||||
`scope` varchar(40) DEFAULT NULL,
|
||||
`access_type` varchar(40) DEFAULT NULL,
|
||||
`permission` varchar(40) NOT NULL COMMENT 'Allow or Deny',
|
||||
`recursive` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if this permission applies recursively in a group/policy hierarchy',
|
||||
`removed` datetime DEFAULT NULL COMMENT 'date the permission was revoked',
|
||||
`created` datetime DEFAULT NULL COMMENT 'date the permission was granted',
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user