diff options
author | Andrey Kumanyaev <me@zzet.org> | 2013-01-21 01:03:29 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-25 00:31:24 +0400 |
commit | b7470440ffbc9cb9f58f9de4b3064760670a20a4 (patch) | |
tree | 0bc2a5db6d7536c6e6c45fbd113c743440dd1075 /lib | |
parent | cca993597013e1359d84230b0f69a2e02edb8e97 (diff) |
Move team project management to own controller
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/user_team_manager.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/user_team_manager.rb b/lib/gitlab/user_team_manager.rb index 753081ea718..7d9a9bdf3f5 100644 --- a/lib/gitlab/user_team_manager.rb +++ b/lib/gitlab/user_team_manager.rb @@ -48,6 +48,20 @@ module Gitlab end end + def update_project_greates_access(team, project, permission) + project_relation = team.user_team_project_relationships.find_by_project_id(project) + if permission != team.max_project_access(project) + if project_relation.update_attributes(greatest_access: permission) + update_team_users_access_in_project(team, project) + true + else + false + end + else + true + end + end + def rebuild_project_permissions_to_member(team, member) team.projects.each do |project| update_team_user_access_in_project(team, member, project) |