Skip auth for group page but return auth for other group pages

This commit is contained in:
Dmitriy Zaporozhets 2015-09-14 11:05:23 +02:00
parent b7431ec042
commit 4c060074b7
4 changed files with 7 additions and 3 deletions

View file

@ -146,7 +146,6 @@
}
.collapse-nav a {
left: 0px;
width: $sidebar_collapsed_width;
}
@ -165,6 +164,7 @@
width: $sidebar_width;
position: fixed;
bottom: 0;
left: 0;
font-size: 13px;
background: transparent;
height: 40px;

View file

@ -4,7 +4,7 @@ class GroupsController < Groups::ApplicationController
before_action :group, except: [:new, :create]
# Authorize
before_action :authorize_read_group!, except: [:new, :create]
before_action :authorize_read_group!, except: [:show, :new, :create]
before_action :authorize_admin_group!, only: [:edit, :update, :destroy, :projects]
before_action :authorize_create_group!, only: [:new, :create]

View file

@ -54,7 +54,7 @@ class Ability
nil
end
if group
if group && group.public_profile?
[:read_group]
else
[]

View file

@ -119,6 +119,10 @@ class Group < Namespace
end
end
def public_profile?
projects.public_only.any?
end
def post_create_hook
Gitlab::AppLogger.info("Group \"#{name}\" was created")