Changeset - 7b52c2351231
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2012-04-13 21:12:42
marcin@python-works.com
permission comments + out identation for better readability
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/user.py
Show inline comments
 
@@ -395,14 +395,14 @@ class UserModel(BaseModel):
 

	
 
            # repositories groups
 
            for perm in default_repo_groups_perms:
 
                rg_k = perm.UserRepoGroupToPerm.group.group_name
 
                p = 'group.admin'
 
                user.permissions[GK][rg_k] = p
 
            return user
 

	
 
        else:
 
            #==================================================================
 
            # set default permissions first for repositories and groups
 
            #==================================================================
 
            uid = user.user_id
 

	
 
            # default global permissions
 
@@ -459,12 +459,13 @@ class UserModel(BaseModel):
 
                if perm.Repository.user_id == uid:
 
                    p = 'repository.admin'
 
                else:
 
                    p = perm.Permission.permission_name
 
                user.permissions[RK][r_k] = p
 

	
 
        # USER GROUP
 
            #==================================================================
 
            # check if user is part of user groups for this repository and
 
            # fill in (or replace with higher) permissions
 
            #==================================================================
 

	
 
            # users group global
 
@@ -492,12 +493,13 @@ class UserModel(BaseModel):
 
                cur_perm = user.permissions[RK][r_k]
 
                # overwrite permission only if it's greater than permission
 
                # given from other sources
 
                if PERM_WEIGHTS[p] > PERM_WEIGHTS[cur_perm]:
 
                    user.permissions[RK][r_k] = p
 

	
 
        # REPO GROUP
 
            #==================================================================
 
            # get access for this user for repos group and override defaults
 
            #==================================================================
 

	
 
            # user explicit permissions for repository
 
            user_repo_groups_perms = \
 
@@ -511,12 +513,13 @@ class UserModel(BaseModel):
 
                rg_k = perm.UserRepoGroupToPerm.group.group_name
 
                p = perm.Permission.permission_name
 
                cur_perm = user.permissions[GK][rg_k]
 
                if PERM_WEIGHTS[p] > PERM_WEIGHTS[cur_perm]:
 
                    user.permissions[GK][rg_k] = p
 

	
 
        # REPO GROUP + USER GROUP
 
            #==================================================================
 
            # check if user is part of user groups for this repo group and
 
            # fill in (or replace with higher) permissions
 
            #==================================================================
 

	
 
            # users group for repositories permissions
0 comments (0 inline, 0 general)