allow/deny user to create group/team
This commit is contained in:
parent
585a53c415
commit
00e4a479d3
4 changed files with 32 additions and 10 deletions
|
@ -6,6 +6,7 @@ class GroupsController < ApplicationController
|
|||
|
||||
# Authorize
|
||||
before_filter :authorize_read_group!, except: [:new, :create]
|
||||
before_filter :authorize_create_group!, only: [:new, :create]
|
||||
|
||||
# Load group projects
|
||||
before_filter :projects, except: [:new, :create]
|
||||
|
@ -103,4 +104,8 @@ class GroupsController < ApplicationController
|
|||
return render_404
|
||||
end
|
||||
end
|
||||
|
||||
def authorize_create_group!
|
||||
can?(current_user, :create_group, nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue