diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-18 15:28:16 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-18 22:58:04 +0300 |
commit | b959ae553b1243e081d557b1e545d30830931e5b (patch) | |
tree | ce6c7410a97d93645fce4eb4ae77f1e8a1f9879b /app/controllers | |
parent | 0a7f7161198feaa9a4cae7c16669a0e6187aed33 (diff) |
Improve group visibility level feature
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/groups_controller.rb | 11 |
2 files changed, 1 insertions, 12 deletions
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb index be801858eaf..795ce50fe92 100644 --- a/app/controllers/groups/application_controller.rb +++ b/app/controllers/groups/application_controller.rb @@ -9,7 +9,7 @@ class Groups::ApplicationController < ApplicationController end def authorize_read_group! - unless @group and can?(current_user, :read_group, @group) + unless @group && can?(current_user, :read_group, @group) if current_user.nil? return authenticate_user! else diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index ba2057eb2c8..b635fb150ae 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -105,17 +105,6 @@ class GroupsController < Groups::ApplicationController @projects ||= ProjectsFinder.new.execute(current_user, group: group).sorted_by_activity end - # Dont allow unauthorized access to group - def authorize_read_group! - unless can?(current_user, :read_group, @group) - if current_user.nil? - return authenticate_user! - else - return render_404 - end - end - end - def authorize_create_group! unless can?(current_user, :create_group, nil) return render_404 |