# HG changeset patch # User Søren Løvborg # Date 2015-07-14 13:59:59 # Node ID a38e328db17258a9509297ad802cc764417cdba3 # Parent 3d3bec370fa5be47f73b4ab889ab8ce545e1c1de 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. diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -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 diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -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