diff --git a/cmdb-api/api/commands/click_cmdb.py b/cmdb-api/api/commands/click_cmdb.py index 51f54d2..f64cad0 100644 --- a/cmdb-api/api/commands/click_cmdb.py +++ b/cmdb-api/api/commands/click_cmdb.py @@ -117,7 +117,15 @@ def cmdb_init_acl(): # 1. add resource type for resource_type in ResourceTypeEnum.all(): try: - ResourceTypeCRUD.add(app_id, resource_type, '', PermEnum.all()) + perms = PermEnum.all() + if resource_type in (ResourceTypeEnum.CI_FILTER, ResourceTypeEnum.PAGE): + perms = [PermEnum.READ] + elif resource_type == ResourceTypeEnum.CI_TYPE_RELATION: + perms = [PermEnum.ADD, PermEnum.DELETE, PermEnum.GRANT] + elif resource_type == ResourceTypeEnum.RELATION_VIEW: + perms = [PermEnum.READ, PermEnum.UPDATE, PermEnum.DELETE, PermEnum.GRANT] + + ResourceTypeCRUD.add(app_id, resource_type, '', perms) except AbortException: pass