fix: 修复工单授权组织问题 (#8599)

Co-authored-by: feng626 <1304903146@qq.com>
pull/8601/head
fit2bot 2022-07-15 11:38:50 +08:00 committed by GitHub
parent 395636296d
commit 93537c07a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -16,16 +16,18 @@ class Handler(BaseHandler):
# permission
def _create_application_permission(self):
with tmp_to_root_org():
org_id = self.ticket.org_id
with tmp_to_org(org_id):
application_permission = ApplicationPermission.objects.filter(id=self.ticket.id).first()
if application_permission:
return application_permission
apply_applications = self.ticket.apply_applications.all()
apply_system_users = self.ticket.apply_system_users.all()
apply_permission_name = self.ticket.apply_permission_name
apply_category = self.ticket.apply_category
apply_type = self.ticket.apply_type
apply_applications = self.ticket.apply_applications.all()
apply_system_users = self.ticket.apply_system_users.all()
apply_date_start = self.ticket.apply_date_start
apply_date_expired = self.ticket.apply_date_expired
permission_created_by = '{}:{}'.format(

View File

@ -16,15 +16,17 @@ class Handler(BaseHandler):
# permission
def _create_asset_permission(self):
with tmp_to_root_org():
org_id = self.ticket.org_id
with tmp_to_org(org_id):
asset_permission = AssetPermission.objects.filter(id=self.ticket.id).first()
if asset_permission:
return asset_permission
apply_nodes = self.ticket.apply_nodes.all()
apply_assets = self.ticket.apply_assets.all()
apply_system_users = self.ticket.apply_system_users.all()
apply_permission_name = self.ticket.apply_permission_name
apply_nodes = self.ticket.apply_nodes.all()
apply_assets = self.ticket.apply_assets.all()
apply_system_users = self.ticket.apply_system_users.all()
apply_actions = self.ticket.apply_actions
apply_date_start = self.ticket.apply_date_start
apply_date_expired = self.ticket.apply_date_expired