Commit 598f360a authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ee-app-differences' into 'master'

Resolve new EE specific differences in app/

Closes #13334

See merge request gitlab-org/gitlab-ee!15040
parents 82ca0857 eb0bccc4
......@@ -7,7 +7,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
before_action :check_membership_lock!, only: [:create, :import, :apply_import]
# rubocop: disable CodeReuse/ActiveRecord
def index
......@@ -51,8 +50,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# MembershipActions concern
alias_method :membershipable, :project
def check_membership_lock!
access_denied!('Membership is locked by group settings') if membership_locked?
end
end
Projects::ProjectMembersController.prepend_if_ee('EE::Projects::ProjectMembersController')
......@@ -2,7 +2,6 @@
class List < ApplicationRecord
prepend ::EE::List # rubocop: disable Cop/InjectEnterpriseEditionModule
include Importable
belongs_to :board
belongs_to :label
......
......@@ -162,7 +162,7 @@ class MergeRequestDiff < ApplicationRecord
# Another set of `after_save` hooks will be called here when we update the record
save
# We need to reset so that dirty tracking is reset when running the original set
# of `after_save` hooks that come after this 'after_create` hook. Otherwise, the
# of `after_save` hooks that come after this `after_create` hook. Otherwise, the
# hooks that run when an attribute was changed are run twice.
reset
......
......@@ -75,7 +75,6 @@ class GroupPolicy < BasePolicy
end
rule { maintainer }.policy do
enable :maintainer_access
enable :create_projects
enable :admin_pipeline
enable :admin_build
......@@ -87,7 +86,6 @@ class GroupPolicy < BasePolicy
end
rule { owner }.policy do
enable :owner_access
enable :admin_group
enable :admin_namespace
enable :admin_group_member
......
......@@ -10,8 +10,6 @@ class DiscussionSerializer < BaseSerializer
private
def with_additional_opts(opts)
return opts unless @request.project
additional_opts = {
submodule_links: Gitlab::SubmoduleLinks.new(@request.project.repository)
}
......@@ -19,3 +17,5 @@ class DiscussionSerializer < BaseSerializer
opts.merge(additional_opts)
end
end
DiscussionSerializer.prepend_if_ee('EE::DiscussionSerializer')
......@@ -2,7 +2,7 @@
class IssueBoardEntity < Grape::Entity
include RequestAwareEntity
prepend ::EE::IssueBoardEntity # rubocop: disable Cop/InjectEnterpriseEditionModule
include TimeTrackableEntity
expose :id
expose :iid
......@@ -50,3 +50,5 @@ class IssueBoardEntity < Grape::Entity
project_labels_path(issue.project, format: :json, include_ancestor_groups: true)
end
end
IssueBoardEntity.prepend_if_ee('EE::IssueBoardEntity')
# frozen_string_literal: true
module EE
module Projects
module ProjectMembersController
extend ActiveSupport::Concern
prepended do
before_action :check_membership_lock!, only: [:create, :import, :apply_import]
end
def check_membership_lock!
access_denied!('Membership is locked by group settings') if membership_locked?
end
end
end
end
......@@ -48,6 +48,11 @@ module EE
rule { maintainer }.policy do
enable :create_jira_connect_subscription
enable :maintainer_access
end
rule { owner }.policy do
enable :owner_access
end
rule { can?(:read_group) & contribution_analytics_available }
......
# frozen_string_literal: true
module EE
module DiscussionSerializer
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
override :with_additional_opts
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def with_additional_opts(opts)
return opts unless @request.project
super
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
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