changeset 3974:39798d53c65d

When using apply to children flag in repo group permission change prompt, RhodeCode only applied this to user groups if repository was private. Only thing that shouldn't be allowed is to change the DEFAULT user permission when repository is private.
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 11 Jun 2013 14:40:00 +0200
parents 7e9494f4c4bf
children 69377d1d7604
files rhodecode/model/repos_group.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/repos_group.py	Tue Jun 11 14:28:05 2013 +0200
+++ b/rhodecode/model/repos_group.py	Tue Jun 11 14:40:00 2013 +0200
@@ -185,8 +185,9 @@
                     repos_group=obj, user=user, perm=perm
                 )
             elif isinstance(obj, Repository):
-                #we do this ONLY IF repository is non-private
-                if obj.private:
+                # private repos will not allow to change the default permissions
+                # using recursive mode
+                if obj.private and user == User.DEFAULT_USER:
                     return
 
                 # we set group permission but we have to switch to repo
@@ -208,6 +209,8 @@
                 RepoModel().grant_users_group_permission(
                     repo=obj, group_name=users_group, perm=perm
                 )
+
+        # start updates
         updates = []
         log.debug('Now updating permissions for %s in recursive mode:%s'
                   % (repos_group, recursive))