# HG changeset patch # User Marcin Kuzminski # Date 1359929982 -3600 # Node ID 14697de1598f2d68717e99cfd7c5c1db42cbee7b # Parent 1af36014d96fea283712ac12d25eac5784a2b674 refactor check_Location => check_location diff -r 1af36014d96f -r 14697de1598f rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py Sun Feb 03 22:58:20 2013 +0100 +++ b/rhodecode/lib/auth.py Sun Feb 03 23:19:42 2013 +0100 @@ -722,7 +722,8 @@ self.repo_name = None self.group_name = None - def __call__(self, check_Location=''): + def __call__(self, check_location=''): + #TODO: put user as attribute here user = request.user cls_name = self.__class__.__name__ check_scope = { @@ -735,19 +736,19 @@ }.get(cls_name, '?') log.debug('checking cls:%s %s usr:%s %s @ %s', cls_name, self.required_perms, user, check_scope, - check_Location or 'unspecified location') + check_location or 'unspecified location') if not user: log.debug('Empty request user') return False self.user_perms = user.permissions if self.check_permissions(): log.debug('Permission to %s granted for user: %s @ %s', self.repo_name, user, - check_Location or 'unspecified location') + check_location or 'unspecified location') return True else: log.debug('Permission to %s denied for user: %s @ %s', self.repo_name, user, - check_Location or 'unspecified location') + check_location or 'unspecified location') return False def check_permissions(self): @@ -770,9 +771,9 @@ class HasRepoPermissionAll(PermsFunction): - def __call__(self, repo_name=None, check_Location=''): + def __call__(self, repo_name=None, check_location=''): self.repo_name = repo_name - return super(HasRepoPermissionAll, self).__call__(check_Location) + return super(HasRepoPermissionAll, self).__call__(check_location) def check_permissions(self): if not self.repo_name: @@ -790,9 +791,9 @@ class HasRepoPermissionAny(PermsFunction): - def __call__(self, repo_name=None, check_Location=''): + def __call__(self, repo_name=None, check_location=''): self.repo_name = repo_name - return super(HasRepoPermissionAny, self).__call__(check_Location) + return super(HasRepoPermissionAny, self).__call__(check_location) def check_permissions(self): if not self.repo_name: @@ -810,9 +811,9 @@ class HasReposGroupPermissionAny(PermsFunction): - def __call__(self, group_name=None, check_Location=''): + def __call__(self, group_name=None, check_location=''): self.group_name = group_name - return super(HasReposGroupPermissionAny, self).__call__(check_Location) + return super(HasReposGroupPermissionAny, self).__call__(check_location) def check_permissions(self): try: @@ -827,9 +828,9 @@ class HasReposGroupPermissionAll(PermsFunction): - def __call__(self, group_name=None, check_Location=''): + def __call__(self, group_name=None, check_location=''): self.group_name = group_name - return super(HasReposGroupPermissionAll, self).__call__(check_Location) + return super(HasReposGroupPermissionAll, self).__call__(check_location) def check_permissions(self): try: