Commit 0c5bae5e authored by Rémy Coutable's avatar Rémy Coutable

Reduce diff with CE in Projects::GroupLinksController

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent c531b2ba
...@@ -4,7 +4,6 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -4,7 +4,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :authorize_admin_project_member!, only: [:update] before_action :authorize_admin_project_member!, only: [:update]
before_action :authorize_group_share!, only: [:create]
def index def index
redirect_to namespace_project_settings_members_path redirect_to namespace_project_settings_members_path
...@@ -45,10 +44,6 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -45,10 +44,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
protected protected
def authorize_group_share!
access_denied! unless project.allowed_to_share_with_group?
end
def group_link_params def group_link_params
params.require(:group_link).permit(:group_access, :expires_at) params.require(:group_link).permit(:group_access, :expires_at)
end end
...@@ -57,3 +52,5 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -57,3 +52,5 @@ class Projects::GroupLinksController < Projects::ApplicationController
params.permit(:link_group_access, :expires_at) params.permit(:link_group_access, :expires_at)
end end
end end
Projects::GroupLinksController.prepend(::EE::Projects::GroupLinksController)
# frozen_string_literal: true
module EE
module Projects
module GroupLinksController
extend ActiveSupport::Concern
prepended do
before_action :authorize_group_share!, only: [:create]
end
protected
def authorize_group_share!
access_denied! unless project.allowed_to_share_with_group?
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment