Changeset - a38e328db172
[Not reviewed]
default
0 2 0
Søren Løvborg - 10 years ago 2015-07-14 13:59:59
kwi@kwi.dk
AuthUser: make get_perms method private

The get_perms method is used exactly once, by the permissions property.

A future, more thorough examination of the code may reveal if it should
stay or go; for now, just make it private. Also, enhance docstring
accuracy.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth.py
Show inline comments
 
@@ -500,7 +500,7 @@ class AuthUser(object):
 

	
 
    @LazyProperty
 
    def permissions(self):
 
        return self.get_perms(user=self, cache=False)
 
        return self.__get_perms(user=self, cache=False)
 

	
 
    @property
 
    def api_keys(self):
 
@@ -544,13 +544,13 @@ class AuthUser(object):
 

	
 
        log.debug('Auth User is now %s' % self)
 

	
 
    def get_perms(self, user, explicit=True, algo='higherwin', cache=False):
 
    def __get_perms(self, user, explicit=True, algo='higherwin', cache=False):
 
        """
 
        Fills user permission attribute with permissions taken from database
 
        works for permissions given for repositories, and for permissions that
 
        are granted to groups
 

	
 
        :param user: instance of User object from database
 
        :param user: `AuthUser` instance
 
        :param explicit: In case there are permissions both for user and a group
 
            that user is part of, explicit flag will define if user will
 
            explicitly override permissions from group, if it's False it will
kallithea/lib/base.py
Show inline comments
 
@@ -182,7 +182,7 @@ class BaseVCSController(object):
 
        name
 

	
 
        :param action: push or pull action
 
        :param user: user instance
 
        :param user: `User` instance
 
        :param repo_name: repository name
 
        """
 
        # check IP
0 comments (0 inline, 0 general)