Mercurial > kallithea
comparison rhodecode/model/user.py @ 3415:b8f929bff7e3 beta
fixed tests and missing replacements from 5f1850e4712a
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 27 Feb 2013 02:27:09 +0100 |
parents | 5f1850e4712a |
children | fa6ba6727475 |
comparison
equal
deleted
inserted
replaced
3414:25c670081761 | 3415:b8f929bff7e3 |
---|---|
510 # those can be configured from groups or users explicitly | 510 # those can be configured from groups or users explicitly |
511 _configurable = set(['hg.fork.none', 'hg.fork.repository', | 511 _configurable = set(['hg.fork.none', 'hg.fork.repository', |
512 'hg.create.none', 'hg.create.repository']) | 512 'hg.create.none', 'hg.create.repository']) |
513 | 513 |
514 # USER GROUPS comes first | 514 # USER GROUPS comes first |
515 # users group global permissions | 515 # user group global permissions |
516 user_perms_from_users_groups = self.sa.query(UsersGroupToPerm)\ | 516 user_perms_from_users_groups = self.sa.query(UsersGroupToPerm)\ |
517 .options(joinedload(UsersGroupToPerm.permission))\ | 517 .options(joinedload(UsersGroupToPerm.permission))\ |
518 .join((UsersGroupMember, UsersGroupToPerm.users_group_id == | 518 .join((UsersGroupMember, UsersGroupToPerm.users_group_id == |
519 UsersGroupMember.users_group_id))\ | 519 UsersGroupMember.users_group_id))\ |
520 .filter(UsersGroupMember.user_id == uid)\ | 520 .filter(UsersGroupMember.user_id == uid)\ |
557 # check if user is part of user groups for this repository and | 557 # check if user is part of user groups for this repository and |
558 # fill in his permission from it. _choose_perm decides of which | 558 # fill in his permission from it. _choose_perm decides of which |
559 # permission should be selected based on selected method | 559 # permission should be selected based on selected method |
560 #====================================================================== | 560 #====================================================================== |
561 | 561 |
562 # users group for repositories permissions | 562 # user group for repositories permissions |
563 user_repo_perms_from_users_groups = \ | 563 user_repo_perms_from_users_groups = \ |
564 self.sa.query(UsersGroupRepoToPerm, Permission, Repository,)\ | 564 self.sa.query(UsersGroupRepoToPerm, Permission, Repository,)\ |
565 .join((Repository, UsersGroupRepoToPerm.repository_id == | 565 .join((Repository, UsersGroupRepoToPerm.repository_id == |
566 Repository.repo_id))\ | 566 Repository.repo_id))\ |
567 .join((Permission, UsersGroupRepoToPerm.permission_id == | 567 .join((Permission, UsersGroupRepoToPerm.permission_id == |
615 #====================================================================== | 615 #====================================================================== |
616 # check if user is part of user groups for this repository groups and | 616 # check if user is part of user groups for this repository groups and |
617 # fill in his permission from it. _choose_perm decides of which | 617 # fill in his permission from it. _choose_perm decides of which |
618 # permission should be selected based on selected method | 618 # permission should be selected based on selected method |
619 #====================================================================== | 619 #====================================================================== |
620 # users group for repo groups permissions | 620 # user group for repo groups permissions |
621 user_repo_group_perms_from_users_groups = \ | 621 user_repo_group_perms_from_users_groups = \ |
622 self.sa.query(UsersGroupRepoGroupToPerm, Permission, RepoGroup)\ | 622 self.sa.query(UsersGroupRepoGroupToPerm, Permission, RepoGroup)\ |
623 .join((RepoGroup, UsersGroupRepoGroupToPerm.group_id == RepoGroup.group_id))\ | 623 .join((RepoGroup, UsersGroupRepoGroupToPerm.group_id == RepoGroup.group_id))\ |
624 .join((Permission, UsersGroupRepoGroupToPerm.permission_id | 624 .join((Permission, UsersGroupRepoGroupToPerm.permission_id |
625 == Permission.permission_id))\ | 625 == Permission.permission_id))\ |