diff options
Diffstat (limited to 'app/models/project_feature.rb')
-rw-r--r-- | app/models/project_feature.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_feature.rb b/app/models/project_feature.rb index 92ba02ec777..36f1e09b2ba 100644 --- a/app/models/project_feature.rb +++ b/app/models/project_feature.rb @@ -173,6 +173,10 @@ class ProjectFeature < ApplicationRecord package_registry_access_level == PUBLIC || project.public? end + def private?(feature) + access_level(feature) == PRIVATE + end + private def set_pages_access_level @@ -201,11 +205,11 @@ class ProjectFeature < ApplicationRecord self.errors.add(field, "cannot have higher visibility level than repository access level") if not_allowed end - %i(merge_requests_access_level builds_access_level).each(&validator) + %i[merge_requests_access_level builds_access_level].each(&validator) end def feature_validation_exclusion - %i(pages package_registry) + %i[pages package_registry] end override :resource_member? |