fix delete relation view

This commit is contained in:
pycook 2019-12-12 21:36:33 +08:00
parent 18122de03e
commit e129b0a32e
2 changed files with 8 additions and 0 deletions

View File

@ -131,6 +131,11 @@ class CITypeManager(object):
CITypeCache.clean(type_id)
if current_app.config.get("USE_ACL"):
from api.lib.perm.acl.acl import ACLManager
from api.lib.cmdb.const import ResourceTypeEnum, RoleEnum, PermEnum
ACLManager().del_resource(ci_type.name, ResourceTypeEnum.CI)
class CITypeGroupManager(object):
@staticmethod

View File

@ -192,4 +192,7 @@ class PreferenceManager(object):
for existed in PreferenceRelationView.get_by(name=name, to_dict=False):
existed.soft_delete()
if current_app.config.get("USE_ACL"):
ACLManager().del_resource(name, ResourceTypeEnum.RELATION_VIEW)
return name