##// END OF EJS Templates
permissions: flush default user permissions on global app permission changes.
marcink -
r3412:18125a8e stable
parent child Browse files
Show More
@@ -32,7 +32,7 b' from pyramid.response import Response'
32
32
33 from rhodecode.apps._base import BaseAppView, DataGridAppView
33 from rhodecode.apps._base import BaseAppView, DataGridAppView
34 from rhodecode.apps.ssh_support import SshKeyFileChangeEvent
34 from rhodecode.apps.ssh_support import SshKeyFileChangeEvent
35 from rhodecode.events import trigger
35 from rhodecode import events
36
36
37 from rhodecode.lib import helpers as h
37 from rhodecode.lib import helpers as h
38 from rhodecode.lib.auth import (
38 from rhodecode.lib.auth import (
@@ -141,6 +141,9 b' class AdminPermissionsView(BaseAppView, '
141 h.flash(_('Error occurred during update of permissions'),
141 h.flash(_('Error occurred during update of permissions'),
142 category='error')
142 category='error')
143
143
144 affected_user_ids = [User.get_default_user().user_id]
145 events.trigger(events.UserPermissionsChange(affected_user_ids))
146
144 raise HTTPFound(h.route_path('admin_permissions_application'))
147 raise HTTPFound(h.route_path('admin_permissions_application'))
145
148
146 @LoginRequired()
149 @LoginRequired()
@@ -214,6 +217,9 b' class AdminPermissionsView(BaseAppView, '
214 h.flash(_('Error occurred during update of permissions'),
217 h.flash(_('Error occurred during update of permissions'),
215 category='error')
218 category='error')
216
219
220 affected_user_ids = [User.get_default_user().user_id]
221 events.trigger(events.UserPermissionsChange(affected_user_ids))
222
217 raise HTTPFound(h.route_path('admin_permissions_object'))
223 raise HTTPFound(h.route_path('admin_permissions_object'))
218
224
219 @LoginRequired()
225 @LoginRequired()
@@ -313,6 +319,9 b' class AdminPermissionsView(BaseAppView, '
313 h.flash(_('Error occurred during update of permissions'),
319 h.flash(_('Error occurred during update of permissions'),
314 category='error')
320 category='error')
315
321
322 affected_user_ids = [User.get_default_user().user_id]
323 events.trigger(events.UserPermissionsChange(affected_user_ids))
324
316 raise HTTPFound(h.route_path('admin_permissions_global'))
325 raise HTTPFound(h.route_path('admin_permissions_global'))
317
326
318 @LoginRequired()
327 @LoginRequired()
@@ -499,7 +508,7 b' class AdminPermissionsView(BaseAppView, '
499 key_file = self.request.registry.settings.get(
508 key_file = self.request.registry.settings.get(
500 'ssh.authorized_keys_file_path')
509 'ssh.authorized_keys_file_path')
501 if ssh_enabled:
510 if ssh_enabled:
502 trigger(SshKeyFileChangeEvent(), self.request.registry)
511 events.trigger(SshKeyFileChangeEvent(), self.request.registry)
503 h.flash(_('Updated SSH keys file: {}').format(key_file),
512 h.flash(_('Updated SSH keys file: {}').format(key_file),
504 category='success')
513 category='success')
505 else:
514 else:
General Comments 0
You need to be logged in to leave comments. Login now