Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
guo xiaoyong
Jumpserver
Commits
24944182
Commit
24944182
authored
3 years ago
by
xinwen
Committed by
Jiangjie.Bai
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: 用户组删除时,授权树不会自动更新
parent
0fec70fe
dev
dependabot/pip/requirements/ansible-4.2.0
feat_acl_muiltistrategy
feat_proxyterminal
master
pr@de@perf_role_bingding_migrations
pr@dev@chore_pylint
pr@dev@connect_token_to_db
pr@dev@feat_csp
pr@dev@feat_custom_platform_auth_change
pr@dev@feat_email_task_audit
pr@dev@fix_tcp_syslog
pr@dev@perf_base_model
pr@dev@refactor_notification_event
pr@dev@refactor_tickiets
pr@dev@share_session_link
pr@dev@tdsql_v5.7
pr@dev@tidb
pr@dev@vault_secret
prr@dev@fix_ldapimport
repr@dev_v2.23_v2.22_v2.21@379c7198@fix_esupdatefailed
v2.12
v2.13
v2.14
v2.15
v2.16
v2.17
v2.18
v2.19
v2.20
v2.21
v2.22
v2.23
v2.23.0
v2.22.3
v2.22.2
v2.22.1
v2.22.0
v2.21.4
v2.21.3
v2.21.2
v2.21.1
v2.21.0
v2.20.3
v2.20.2
v2.20.1
v2.20.0
v2.19.2
v2.19.1
v2.19.0
v2.18.3
v2.18.2
v2.18.1
v2.18.0
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.3
v2.16.2
v2.16.1
v2.16.0
v2.15.5
v2.15.4
v2.15.3
v2.15.2
v2.15.1
v2.15.0
v2.14.2
v2.14.1
v2.14.0
v2.13.2
v2.13.1
v2.13.0
v2.12.2
v2.12.1
v2.12.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/perms/signals_handler/refresh_perms.py
+11
-0
apps/perms/signals_handler/refresh_perms.py
with
11 additions
and
0 deletions
+11
-0
apps/perms/signals_handler/refresh_perms.py
+
11
-
0
View file @
24944182
...
...
@@ -16,6 +16,17 @@ from perms.utils.asset.user_permission import UserGrantedTreeRefreshController
logger
=
get_logger
(
__file__
)
@
receiver
(
pre_delete
,
sender
=
UserGroup
)
def
on_user_group_delete
(
sender
,
instance
:
UserGroup
,
using
,
**
kwargs
):
exists
=
AssetPermission
.
user_groups
.
through
.
objects
.
filter
(
usergroup_id
=
instance
.
id
).
exists
()
if
not
exists
:
return
org_id
=
instance
.
org_id
user_ids
=
UserGroup
.
users
.
through
.
objects
.
filter
(
usergroup_id
=
instance
.
id
).
values_list
(
'user_id'
,
flat
=
True
)
UserGrantedTreeRefreshController
.
add_need_refresh_orgs_for_users
([
org_id
],
list
(
user_ids
))
@
receiver
(
m2m_changed
,
sender
=
User
.
groups
.
through
)
def
on_user_groups_change
(
sender
,
instance
,
action
,
reverse
,
pk_set
,
**
kwargs
):
if
not
action
.
startswith
(
'post'
):
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help