permissions: flush all when running remap and rescan.
This commit is contained in:
parent
c9dcf808c6
commit
4fac5279f8
2 changed files with 6 additions and 3 deletions
|
|
@ -47,6 +47,7 @@ from rhodecode.model.db import RhodeCodeUi, Repository
|
|||
from rhodecode.model.forms import (ApplicationSettingsForm,
|
||||
ApplicationUiSettingsForm, ApplicationVisualisationForm,
|
||||
LabsSettingsForm, IssueTrackerPatternsForm)
|
||||
from rhodecode.model.permission import PermissionModel
|
||||
from rhodecode.model.repo_group import RepoGroupModel
|
||||
|
||||
from rhodecode.model.scm import ScmModel
|
||||
|
|
@ -253,8 +254,7 @@ class AdminSettingsView(BaseAppView):
|
|||
c.active = 'mapping'
|
||||
rm_obsolete = self.request.POST.get('destroy', False)
|
||||
invalidate_cache = self.request.POST.get('invalidate', False)
|
||||
log.debug(
|
||||
'rescanning repo location with destroy obsolete=%s', rm_obsolete)
|
||||
log.debug('rescanning repo location with destroy obsolete=%s', rm_obsolete)
|
||||
|
||||
if invalidate_cache:
|
||||
log.debug('invalidating all repositories cache')
|
||||
|
|
@ -263,6 +263,8 @@ class AdminSettingsView(BaseAppView):
|
|||
|
||||
filesystem_repos = ScmModel().repo_scan()
|
||||
added, removed = repo2db_mapper(filesystem_repos, rm_obsolete)
|
||||
PermissionModel().trigger_permission_flush()
|
||||
|
||||
_repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
|
||||
h.flash(_('Repositories successfully '
|
||||
'rescanned added: %s ; removed: %s') %
|
||||
|
|
|
|||
|
|
@ -577,7 +577,8 @@ class PermissionModel(BaseModel):
|
|||
user_group_write_permissions[p.users_group_id] = p
|
||||
return user_group_write_permissions
|
||||
|
||||
def trigger_permission_flush(self, affected_user_ids):
|
||||
def trigger_permission_flush(self, affected_user_ids=None):
|
||||
affected_user_ids or User.get_all_user_ids()
|
||||
events.trigger(events.UserPermissionsChange(affected_user_ids))
|
||||
|
||||
def flush_user_permission_caches(self, changes, affected_user_ids=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue