diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/invite_members_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/namespaces_helper.rb | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/app/helpers/invite_members_helper.rb b/app/helpers/invite_members_helper.rb index acd343da338..889c058cb21 100644 --- a/app/helpers/invite_members_helper.rb +++ b/app/helpers/invite_members_helper.rb @@ -3,10 +3,6 @@ module InviteMembersHelper include Gitlab::Utils::StrongMemoize - def can_invite_members_for_group?(group) - Feature.enabled?(:invite_members_group_modal, group) && can?(current_user, :admin_group_member, group) - end - def can_invite_members_for_project?(project) Feature.enabled?(:invite_members_group_modal, project.group) && can_manage_project_members?(project) end diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index a4521541bf9..cf5fdc091af 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -83,6 +83,15 @@ module NamespacesHelper } end + def cascading_namespace_setting_locked?(attribute, group, **args) + return false if group.nil? + + method_name = "#{attribute}_locked?" + return false unless group.namespace_settings.respond_to?(method_name) + + group.namespace_settings.public_send(method_name, **args) # rubocop:disable GitlabSecurity/PublicSend + end + private # Many importers create a temporary Group, so use the real |