From 573d367be5a61e9b344e48b6678cdd8067fe6bd1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Sep 2013 14:05:35 +0300 Subject: 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 --- app/models/group.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/group.rb') 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 -- cgit v1.2.1