summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 08:17:02 +0000
commitb39512ed755239198a9c294b6a45e65c05900235 (patch)
treed234a3efade1de67c46b9e5a38ce813627726aa7 /app/models/group.rb
parentd31474cf3b17ece37939d20082b07f6657cc79a9 (diff)
downloadgitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 6d8f8bd7613..55455d85531 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -149,7 +149,7 @@ class Group < Namespace
add_authentication_token_field :runners_token,
encrypted: -> { Feature.enabled?(:groups_tokens_optional_encryption) ? :optional : :required },
- prefix: RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX
+ prefix: RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX
after_create :post_create_hook
after_destroy :post_destroy_hook
@@ -176,6 +176,16 @@ class Group < Namespace
.where(project_authorizations: { user_id: user_ids })
end
+ scope :project_creation_allowed, -> do
+ permitted_levels = [
+ ::Gitlab::Access::DEVELOPER_MAINTAINER_PROJECT_ACCESS,
+ ::Gitlab::Access::MAINTAINER_PROJECT_ACCESS,
+ nil
+ ]
+
+ where(project_creation_level: permitted_levels)
+ end
+
class << self
def sort_by_attribute(method)
if method == 'storage_size_desc'
@@ -855,6 +865,14 @@ class Group < Namespace
feature_flag_enabled_for_self_or_ancestor?(:work_items)
end
+ def work_items_mvc_2_feature_flag_enabled?
+ feature_flag_enabled_for_self_or_ancestor?(:work_items_mvc_2)
+ end
+
+ def work_items_create_from_markdown_feature_flag_enabled?
+ feature_flag_enabled_for_self_or_ancestor?(:work_items_create_from_markdown)
+ end
+
# Check for enabled features, similar to `Project#feature_available?`
# NOTE: We still want to keep this after removing `Namespace#feature_available?`.
override :feature_available?