##// END OF EJS Templates
branch permissions: fixed a case of showing branch permissions entries when inheritation model is used....
dan -
r3154:ea307128 default
parent child Browse files
Show More
@@ -68,7 +68,6 b' class PasswordGenerator(object):'
68 68 This is a simple class for generating password from different sets of
69 69 characters
70 70 usage::
71
72 71 passwd_gen = PasswordGenerator()
73 72 #print 8-letter password containing only big and small letters
74 73 of alphabet
@@ -628,8 +627,11 b' class PermissionCalculator(object):'
628 627 o = PermOrigin.REPO_USER % perm.UserRepoToPerm.user.username
629 628
630 629 if not self.explicit:
631 # TODO(marcink): fix this for multiple entries
632 cur_perm = self.permissions_repository_branches.get(r_k) or 'branch.none'
630 cur_perm = self.permissions_repository_branches.get(r_k)
631 if cur_perm:
632 cur_perm = cur_perm[pattern]
633 cur_perm = cur_perm or 'branch.none'
634
633 635 p = self._choose_permission(p, cur_perm)
634 636
635 637 # NOTE(marcink): register all pattern/perm instances in this
@@ -801,8 +803,7 b' class PermissionCalculator(object):'
801 803
802 804 multiple_counter[r_k] += 1
803 805 if multiple_counter[r_k] > 1:
804 # TODO(marcink): fix this for multi branch support, and multiple entries
805 cur_perm = self.permissions_repository_branches[r_k]
806 cur_perm = self.permissions_repository_branches[r_k][pattern]
806 807 p = self._choose_permission(p, cur_perm)
807 808
808 809 self.permissions_repository_branches[r_k] = pattern, p, o
@@ -820,8 +821,10 b' class PermissionCalculator(object):'
820 821 o = PermOrigin.REPO_USER % perm.UserRepoToPerm.user.username
821 822
822 823 if not self.explicit:
823 # TODO(marcink): fix this for multiple entries
824 cur_perm = self.permissions_repository_branches.get(r_k) or 'branch.none'
824 cur_perm = self.permissions_repository_branches.get(r_k)
825 if cur_perm:
826 cur_perm = cur_perm[pattern]
827 cur_perm = cur_perm or 'branch.none'
825 828 p = self._choose_permission(p, cur_perm)
826 829
827 830 # NOTE(marcink): register all pattern/perm instances in this
@@ -875,8 +878,7 b' class PermissionCalculator(object):'
875 878 p = perm.Permission.permission_name
876 879
877 880 if not self.explicit:
878 cur_perm = self.permissions_repository_groups.get(
879 rg_k, 'group.none')
881 cur_perm = self.permissions_repository_groups.get(rg_k, 'group.none')
880 882 p = self._choose_permission(p, cur_perm)
881 883
882 884 self.permissions_repository_groups[rg_k] = p, o
@@ -937,8 +939,7 b' class PermissionCalculator(object):'
937 939 p = perm.Permission.permission_name
938 940
939 941 if not self.explicit:
940 cur_perm = self.permissions_user_groups.get(
941 ug_k, 'usergroup.none')
942 cur_perm = self.permissions_user_groups.get(ug_k, 'usergroup.none')
942 943 p = self._choose_permission(p, cur_perm)
943 944
944 945 self.permissions_user_groups[ug_k] = p, o
General Comments 0
You need to be logged in to leave comments. Login now