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