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