##// END OF EJS Templates
permissions: flush members of user groups permissions to clear caches....
marcink -
r3153:37902585 default
parent child Browse files
Show More
@@ -29,6 +29,8 b' from rhodecode.lib import helpers as h'
29 from rhodecode.lib import audit_logger
29 from rhodecode.lib import audit_logger
30 from rhodecode.lib.auth import (
30 from rhodecode.lib.auth import (
31 LoginRequired, HasRepoGroupPermissionAnyDecorator, CSRFRequired)
31 LoginRequired, HasRepoGroupPermissionAnyDecorator, CSRFRequired)
32 from rhodecode.lib.utils2 import safe_int
33 from rhodecode.model.db import UserGroup
32 from rhodecode.model.repo_group import RepoGroupModel
34 from rhodecode.model.repo_group import RepoGroupModel
33 from rhodecode.model.forms import RepoGroupPermsForm
35 from rhodecode.model.forms import RepoGroupPermsForm
34 from rhodecode.model.meta import Session
36 from rhodecode.model.meta import Session
@@ -101,6 +103,11 b' class RepoGroupPermissionsView(RepoGroup'
101 for change in changes['added'] + changes['updated'] + changes['deleted']:
103 for change in changes['added'] + changes['updated'] + changes['deleted']:
102 if change['type'] == 'user':
104 if change['type'] == 'user':
103 affected_user_ids.append(change['id'])
105 affected_user_ids.append(change['id'])
106 if change['type'] == 'user_group':
107 user_group = UserGroup.get(safe_int(change['id']))
108 if user_group:
109 group_members_ids = [x.user_id for x in user_group.members]
110 affected_user_ids.extend(group_members_ids)
104
111
105 events.trigger(events.UserPermissionsChange(affected_user_ids))
112 events.trigger(events.UserPermissionsChange(affected_user_ids))
106
113
@@ -29,6 +29,8 b' from rhodecode.lib import helpers as h'
29 from rhodecode.lib import audit_logger
29 from rhodecode.lib import audit_logger
30 from rhodecode.lib.auth import (
30 from rhodecode.lib.auth import (
31 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
31 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
32 from rhodecode.lib.utils2 import safe_int
33 from rhodecode.model.db import UserGroup
32 from rhodecode.model.forms import RepoPermsForm
34 from rhodecode.model.forms import RepoPermsForm
33 from rhodecode.model.meta import Session
35 from rhodecode.model.meta import Session
34 from rhodecode.model.repo import RepoModel
36 from rhodecode.model.repo import RepoModel
@@ -88,6 +90,11 b' class RepoSettingsPermissionsView(RepoAp'
88 for change in changes['added'] + changes['updated'] + changes['deleted']:
90 for change in changes['added'] + changes['updated'] + changes['deleted']:
89 if change['type'] == 'user':
91 if change['type'] == 'user':
90 affected_user_ids.append(change['id'])
92 affected_user_ids.append(change['id'])
93 if change['type'] == 'user_group':
94 user_group = UserGroup.get(safe_int(change['id']))
95 if user_group:
96 group_members_ids = [x.user_id for x in user_group.members]
97 affected_user_ids.extend(group_members_ids)
91
98
92 events.trigger(events.UserPermissionsChange(affected_user_ids))
99 events.trigger(events.UserPermissionsChange(affected_user_ids))
93
100
@@ -40,8 +40,8 b' from rhodecode.apps._base import UserGro'
40 from rhodecode.lib.auth import (
40 from rhodecode.lib.auth import (
41 LoginRequired, HasUserGroupPermissionAnyDecorator, CSRFRequired)
41 LoginRequired, HasUserGroupPermissionAnyDecorator, CSRFRequired)
42 from rhodecode.lib import helpers as h, audit_logger
42 from rhodecode.lib import helpers as h, audit_logger
43 from rhodecode.lib.utils2 import str2bool
43 from rhodecode.lib.utils2 import str2bool, safe_int
44 from rhodecode.model.db import User
44 from rhodecode.model.db import User, UserGroup
45 from rhodecode.model.meta import Session
45 from rhodecode.model.meta import Session
46 from rhodecode.model.user_group import UserGroupModel
46 from rhodecode.model.user_group import UserGroupModel
47
47
@@ -377,6 +377,11 b' class UserGroupsView(UserGroupAppView):'
377 for change in changes['added'] + changes['updated'] + changes['deleted']:
377 for change in changes['added'] + changes['updated'] + changes['deleted']:
378 if change['type'] == 'user':
378 if change['type'] == 'user':
379 affected_user_ids.append(change['id'])
379 affected_user_ids.append(change['id'])
380 if change['type'] == 'user_group':
381 user_group = UserGroup.get(safe_int(change['id']))
382 if user_group:
383 group_members_ids = [x.user_id for x in user_group.members]
384 affected_user_ids.extend(group_members_ids)
380
385
381 events.trigger(events.UserPermissionsChange(affected_user_ids))
386 events.trigger(events.UserPermissionsChange(affected_user_ids))
382
387
General Comments 0
You need to be logged in to leave comments. Login now