Mercurial > kallithea
comparison rhodecode/lib/auth.py @ 3371:199fd214b213 beta
Show admin dropdown for users who are admin of repo groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 15 Feb 2013 00:53:47 +0100 |
parents | fdb0f59b2189 |
children | b8f929bff7e3 |
comparison
equal
deleted
inserted
replaced
3370:fdb0f59b2189 | 3371:199fd214b213 |
---|---|
399 @property | 399 @property |
400 def is_admin(self): | 400 def is_admin(self): |
401 return self.admin | 401 return self.admin |
402 | 402 |
403 @property | 403 @property |
404 def repos_admin(self): | |
405 """ | |
406 Returns list of repositories you're an admin of | |
407 """ | |
408 return [x[0] for x in self.permissions['repositories'].iteritems() | |
409 if x[1] == 'repository.admin'] | |
410 | |
411 @property | |
412 def groups_admin(self): | |
413 """ | |
414 Returns list of repositories groups you're an admin of | |
415 """ | |
416 return [x[0] for x in self.permissions['repositories_groups'].iteritems() | |
417 if x[1] == 'group.admin'] | |
418 | |
419 @property | |
404 def ip_allowed(self): | 420 def ip_allowed(self): |
405 """ | 421 """ |
406 Checks if ip_addr used in constructor is allowed from defined list of | 422 Checks if ip_addr used in constructor is allowed from defined list of |
407 allowed ip_addresses for user | 423 allowed ip_addresses for user |
408 | 424 |