Merge pull request !2743 from rhodecode-enterprise-ce RCCE-247-group-permissions
fix: RCCE-247 branch permissions with user groups
This commit is contained in:
commit
ff89650fc0
1 changed files with 4 additions and 2 deletions
|
|
@ -413,7 +413,7 @@ class BranchPermOriginDict(dict):
|
|||
|
||||
else:
|
||||
(pattern_perm, origin) = pattern_perm_origin
|
||||
# we're passing in the dict, so we save the the stack
|
||||
# we're passing in the dict, so we save the stack
|
||||
for pattern, perm in list(pattern_perm.items()):
|
||||
self.perm_origin_stack.setdefault(key, {}).setdefault(pattern, []).append((perm, origin))
|
||||
|
||||
|
|
@ -849,7 +849,9 @@ class PermissionCalculator(object):
|
|||
|
||||
multiple_counter[r_k] += 1
|
||||
if multiple_counter[r_k] > 1:
|
||||
cur_perm = self.permissions_repository_branches[r_k][pattern]
|
||||
# Get the previous permission for this pattern, with fallback, from perm_origin_stack that keeps history
|
||||
pattern_perms = self.permissions_repository_branches.perm_origin_stack.get(r_k, {}).get(pattern, [])
|
||||
cur_perm = pattern_perms[0][0] if pattern_perms else "branch.none"
|
||||
p = self._choose_permission(p, cur_perm)
|
||||
|
||||
self.permissions_repository_branches[r_k] = {pattern: p}, o
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue