Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-25 15:05:35 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-25 15:05:35 +0400
commit573d367be5a61e9b344e48b6678cdd8067fe6bd1 (patch)
treeae1b3d887b6fa6716e62a40ebc9548230e74fdab /app/models/group.rb
parent087d7e554f603faf946ea7ccb910e7b99a0801c2 (diff)
Modify permissions for project and group
* Hooks and team pages allowed only for masters/owners * Group page allowed for admin * Corrent authentication for Projects controller * Hide some project elements from visitor
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index fce8d71217b..0b36c934375 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -32,6 +32,10 @@ class Group < Namespace
end
end
+ def add_user(user, group_access)
+ self.users_groups.create(user_id: user.id, group_access: group_access)
+ end
+
def change_owner(user)
self.owner = user
membership = users_groups.where(user_id: user.id).first