diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-08 21:01:33 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-10 10:38:36 -0300 |
commit | c3e70280dffe7ee0859ebd73b902d424ca5f809a (patch) | |
tree | 06b83a5ab13d19803332253cf50a941501b29317 /app/controllers | |
parent | bd59e59d01c5e845c7f7d451feaa1488670f20de (diff) | |
download | gitlab-ce-c3e70280dffe7ee0859ebd73b902d424ca5f809a.tar.gz |
Prevent projects to have higher visibility than groups
Prevent Groups to have smaller visibility than projects
Add default_group_visibility_level to configuration
Code improvements
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/groups_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/namespaces_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/users_controller.rb | 5 |
4 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 04a99d8c84a..ed9f6031389 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -61,6 +61,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :session_expire_delay, :default_project_visibility, :default_snippet_visibility, + :default_group_visibility, :restricted_signup_domains_raw, :version_check_enabled, :admin_notification_email, diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 6532eee1602..54f14e62ead 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -79,7 +79,7 @@ class GroupsController < Groups::ApplicationController end def update - if @group.update_attributes(group_params) + if Groups::UpdateService.new(@group, current_user, group_params).execute redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated." else render action: "edit" diff --git a/app/controllers/namespaces_controller.rb b/app/controllers/namespaces_controller.rb index 282012c60a1..5a94dcb0dbd 100644 --- a/app/controllers/namespaces_controller.rb +++ b/app/controllers/namespaces_controller.rb @@ -14,7 +14,7 @@ class NamespacesController < ApplicationController if user redirect_to user_path(user) - elsif group + elsif group && can?(current_user, :read_group, namespace) redirect_to group_path(group) elsif current_user.nil? authenticate_user! diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d26a1ce6737..7b32572f822 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,16 +3,13 @@ class UsersController < ApplicationController before_action :set_user def show -<<<<<<< HEAD -======= @contributed_projects = contributed_projects.joined(@user).reject(&:forked?) @projects = PersonalProjectsFinder.new(@user).execute(current_user) @projects = @projects.page(params[:page]).per(PER_PAGE) - @groups = @user.groups.order_id_desc + @groups = JoinedGroupsFinder.new(@user).execute(current_user) ->>>>>>> Code improvements respond_to do |format| format.html |