Commit 150e6170 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Rename `ref_permissions_for_users` `protected_refs_for_users`

parent 5f2f551c
...@@ -20,7 +20,7 @@ module EE ...@@ -20,7 +20,7 @@ module EE
conditions: -> { where(user_id: nil, group_id: nil) } } conditions: -> { where(user_id: nil, group_id: nil) } }
validates :group, :user, validates :group, :user,
absence: true, absence: true,
unless: :ref_permissions_for_users_required_and_available unless: :protected_refs_for_users_required_and_available
scope :by_user, -> (user) { where(user: user ) } scope :by_user, -> (user) { where(user: user ) }
scope :by_group, -> (group) { where(group: group ) } scope :by_group, -> (group) { where(group: group ) }
...@@ -63,8 +63,8 @@ module EE ...@@ -63,8 +63,8 @@ module EE
# #
# If it applies to a user/group we can only skip validation `nil`-validation # If it applies to a user/group we can only skip validation `nil`-validation
# if the feature is available # if the feature is available
def ref_permissions_for_users_required_and_available def protected_refs_for_users_required_and_available
type != :role && project.feature_available?(:ref_permissions_for_users) type != :role && project.feature_available?(:protected_refs_for_users)
end end
end end
end end
...@@ -21,8 +21,8 @@ class License < ActiveRecord::Base ...@@ -21,8 +21,8 @@ class License < ActiveRecord::Base
MULTIPLE_ISSUE_ASSIGNEES_FEATURE = 'GitLab_MultipleIssueAssignees'.freeze MULTIPLE_ISSUE_ASSIGNEES_FEATURE = 'GitLab_MultipleIssueAssignees'.freeze
MULTIPLE_ISSUE_BOARDS_FEATURE = 'GitLab_MultipleIssueBoards'.freeze MULTIPLE_ISSUE_BOARDS_FEATURE = 'GitLab_MultipleIssueBoards'.freeze
OBJECT_STORAGE_FEATURE = 'GitLab_ObjectStorage'.freeze OBJECT_STORAGE_FEATURE = 'GitLab_ObjectStorage'.freeze
PROTECTED_REFS_FOR_USERS_FEATURE = 'GitLab_RefPermissionsForUsers'.freeze
PUSH_RULES_FEATURE = 'GitLab_PushRules'.freeze PUSH_RULES_FEATURE = 'GitLab_PushRules'.freeze
REF_PERMISSIONS_FOR_USERS_FEATURE = 'GitLab_RefPermissionsForUsers'.freeze
RELATED_ISSUES_FEATURE = 'RelatedIssues'.freeze RELATED_ISSUES_FEATURE = 'RelatedIssues'.freeze
SERVICE_DESK_FEATURE = 'GitLab_ServiceDesk'.freeze SERVICE_DESK_FEATURE = 'GitLab_ServiceDesk'.freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE = 'GitLab_VariableEnvironmentScope'.freeze VARIABLE_ENVIRONMENT_SCOPE_FEATURE = 'GitLab_VariableEnvironmentScope'.freeze
...@@ -53,7 +53,8 @@ class License < ActiveRecord::Base ...@@ -53,7 +53,8 @@ class License < ActiveRecord::Base
merge_request_squash: MERGE_REQUEST_SQUASH_FEATURE, merge_request_squash: MERGE_REQUEST_SQUASH_FEATURE,
multiple_issue_assignees: MULTIPLE_ISSUE_ASSIGNEES_FEATURE, multiple_issue_assignees: MULTIPLE_ISSUE_ASSIGNEES_FEATURE,
multiple_issue_boards: MULTIPLE_ISSUE_BOARDS_FEATURE, multiple_issue_boards: MULTIPLE_ISSUE_BOARDS_FEATURE,
ref_permissions_for_users: REF_PERMISSIONS_FOR_USERS_FEATURE protected_refs_for_users: PROTECTED_REFS_FOR_USERS_FEATURE,
push_rules: PUSH_RULES_FEATURE
}.freeze }.freeze
STARTER_PLAN = 'starter'.freeze STARTER_PLAN = 'starter'.freeze
...@@ -78,7 +79,7 @@ class License < ActiveRecord::Base ...@@ -78,7 +79,7 @@ class License < ActiveRecord::Base
{ MULTIPLE_ISSUE_ASSIGNEES_FEATURE => 1 }, { MULTIPLE_ISSUE_ASSIGNEES_FEATURE => 1 },
{ MULTIPLE_ISSUE_BOARDS_FEATURE => 1 }, { MULTIPLE_ISSUE_BOARDS_FEATURE => 1 },
{ PUSH_RULES_FEATURE => 1 }, { PUSH_RULES_FEATURE => 1 },
{ REF_PERMISSIONS_FOR_USERS_FEATURE => 1 }, { PROTECTED_REFS_FOR_USERS_FEATURE => 1 },
{ RELATED_ISSUES_FEATURE => 1 } { RELATED_ISSUES_FEATURE => 1 }
].freeze ].freeze
...@@ -124,8 +125,8 @@ class License < ActiveRecord::Base ...@@ -124,8 +125,8 @@ class License < ActiveRecord::Base
{ MULTIPLE_ISSUE_ASSIGNEES_FEATURE => 1 }, { MULTIPLE_ISSUE_ASSIGNEES_FEATURE => 1 },
{ MULTIPLE_ISSUE_BOARDS_FEATURE => 1 }, { MULTIPLE_ISSUE_BOARDS_FEATURE => 1 },
{ OBJECT_STORAGE_FEATURE => 1 }, { OBJECT_STORAGE_FEATURE => 1 },
{ PROTECTED_REFS_FOR_USERS_FEATURE => 1 },
{ PUSH_RULES_FEATURE => 1 }, { PUSH_RULES_FEATURE => 1 },
{ REF_PERMISSIONS_FOR_USERS_FEATURE => 1 },
{ SERVICE_DESK_FEATURE => 1 } { SERVICE_DESK_FEATURE => 1 }
].freeze ].freeze
......
- expanded = Rails.env.test? - expanded = Rails.env.test?
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
- if @project.feature_available?(:ref_permissions_for_users, current_user) - if @project.feature_available?(:protected_refs_for_users, current_user)
= webpack_bundle_tag('ee_protected_branches') = webpack_bundle_tag('ee_protected_branches')
- else - else
= webpack_bundle_tag('protected_branches') = webpack_bundle_tag('protected_branches')
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= render "projects/push_rules/index" = render "projects/push_rules/index"
= render "projects/mirrors/show" = render "projects/mirrors/show"
- if @project.feature_available?(:ref_permissions_for_users, current_user) - if @project.feature_available?(:protected_refs_for_users, current_user)
= render "projects/protected_branches/ee/index" = render "projects/protected_branches/ee/index"
= render "projects/protected_tags/ee/index" = render "projects/protected_tags/ee/index"
- else - else
......
...@@ -104,7 +104,7 @@ feature 'Protected Branches', feature: true, js: true do ...@@ -104,7 +104,7 @@ feature 'Protected Branches', feature: true, js: true do
describe "access control" do describe "access control" do
describe 'with ref permissions for users enabled' do describe 'with ref permissions for users enabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: true) stub_licensed_features(protected_refs_for_users: true)
end end
include_examples "protected branches > access control > EE" include_examples "protected branches > access control > EE"
...@@ -112,7 +112,7 @@ feature 'Protected Branches', feature: true, js: true do ...@@ -112,7 +112,7 @@ feature 'Protected Branches', feature: true, js: true do
describe 'with ref permissions for users disabled' do describe 'with ref permissions for users disabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: false) stub_licensed_features(protected_refs_for_users: false)
end end
include_examples "protected branches > access control > CE" include_examples "protected branches > access control > CE"
......
...@@ -108,7 +108,7 @@ feature 'Projected Tags', feature: true, js: true do ...@@ -108,7 +108,7 @@ feature 'Projected Tags', feature: true, js: true do
describe "access control" do describe "access control" do
describe 'with ref permissions for users enabled' do describe 'with ref permissions for users enabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: true) stub_licensed_features(protected_refs_for_users: true)
end end
include_examples "protected tags > access control > EE" include_examples "protected tags > access control > EE"
...@@ -116,7 +116,7 @@ feature 'Projected Tags', feature: true, js: true do ...@@ -116,7 +116,7 @@ feature 'Projected Tags', feature: true, js: true do
describe 'with ref permissions for users disabled' do describe 'with ref permissions for users disabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: false) stub_licensed_features(protected_refs_for_users: false)
end end
include_examples "protected tags > access control > CE" include_examples "protected tags > access control > CE"
......
...@@ -16,9 +16,9 @@ describe EE::ProtectedRefAccess do ...@@ -16,9 +16,9 @@ describe EE::ProtectedRefAccess do
expect(included_in_class.included_modules).to include(described_class) expect(included_in_class.included_modules).to include(described_class)
end end
context 'with the `ref_permissions_for_users` feature disabled' do context 'with the `protected_refs_for_users` feature disabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: false) stub_licensed_features(protected_refs_for_users: false)
end end
it "allows creating an #{included_in_class} with a group" do it "allows creating an #{included_in_class} with a group" do
...@@ -36,9 +36,9 @@ describe EE::ProtectedRefAccess do ...@@ -36,9 +36,9 @@ describe EE::ProtectedRefAccess do
end end
end end
context 'with the `ref_permissions_for_users` feature enabled' do context 'with the `protected_refs_for_users` feature enabled' do
before do before do
stub_licensed_features(ref_permissions_for_users: true) stub_licensed_features(protected_refs_for_users: true)
end end
it "allows creating an #{included_in_class} with a group" do it "allows creating an #{included_in_class} with a group" do
......
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