Commit a0d7fef1 authored by Mario de la Ossa's avatar Mario de la Ossa

Change `related_issues` license feature to `blocked_issues`

We're moving related issues to core but keeping blocked issues in EE
parent ce7c9d43
......@@ -231,6 +231,7 @@ class ProjectPolicy < BasePolicy
enable :admin_issue
enable :admin_label
enable :admin_list
enable :admin_issue_link
enable :read_commit_status
enable :read_build
enable :read_container_image
......@@ -544,6 +545,7 @@ class ProjectPolicy < BasePolicy
rule { can?(:read_issue) }.policy do
enable :read_design
enable :read_design_activity
enable :read_issue_link
end
# Design abilities could also be prevented in the issue policy.
......
......@@ -10,6 +10,7 @@ class License < ApplicationRecord
EES_FEATURES = %i[
audit_events
blocked_issues
burndown_charts
code_owners
code_review_analytics
......@@ -33,7 +34,6 @@ class License < ApplicationRecord
project_merge_request_analytics
protected_refs_for_users
push_rules
related_issues
repository_mirrors
repository_size_limit
seat_link
......
......@@ -7,7 +7,7 @@ module EE
prepended do
with_scope :subject
condition(:related_issues_disabled) { !@subject.feature_available?(:related_issues) }
condition(:related_issues_disabled) { !@subject.feature_available?(:blocked_issues) }
with_scope :subject
condition(:repository_mirrors_enabled) { @subject.feature_available?(:repository_mirrors) }
......@@ -197,16 +197,11 @@ module EE
rule { ~group_timelogs_available }.prevent :read_group_timelogs
rule { can?(:read_issue) }.policy do
enable :read_issue_link
end
rule { can?(:guest_access) & iterations_available }.enable :read_iteration
rule { can?(:reporter_access) }.policy do
enable :admin_board
enable :read_deploy_board
enable :admin_issue_link
enable :admin_epic_issue
enable :read_group_timelogs
end
......
......@@ -173,7 +173,7 @@ RSpec.describe Projects::FeatureFlagIssuesController do
end
it 'returns not found when related issues feature is unavailable' do
stub_licensed_features(related_issues: false)
stub_licensed_features(blocked_issues: false)
feature_flag, _issue = setup
sign_in(developer)
......@@ -333,7 +333,7 @@ RSpec.describe Projects::FeatureFlagIssuesController do
end
it 'does not create a link when the related issues feature is unavailable' do
stub_licensed_features(related_issues: false)
stub_licensed_features(blocked_issues: false)
feature_flag, issue = setup
sign_in(developer)
......@@ -401,7 +401,7 @@ RSpec.describe Projects::FeatureFlagIssuesController do
end
it 'does not unlink the issue when the related issues feature is unavailable' do
stub_licensed_features(related_issues: false)
stub_licensed_features(blocked_issues: false)
feature_flag, issue, link = setup
sign_in(developer)
......
......@@ -25,7 +25,7 @@ RSpec.describe Projects::IssueLinksController do
end
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
project.add_developer(user)
end
......@@ -58,7 +58,7 @@ RSpec.describe Projects::IssueLinksController do
context 'when related issues are available on the project' do
before do
project.add_developer(user)
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
stub_feature_flags(link_types: true)
end
......@@ -75,7 +75,7 @@ RSpec.describe Projects::IssueLinksController do
context 'when related issues are not available on the project' do
before do
stub_licensed_features(related_issues: false)
stub_licensed_features(blocked_issues: false)
end
it 'returns 403' do
......
......@@ -16,7 +16,7 @@ RSpec.describe 'Related issues', :js do
context 'widget visibility' do
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
end
context 'when not logged in' do
......@@ -189,7 +189,7 @@ RSpec.describe 'Related issues', :js do
let!(:issue_link_c) { create :issue_link, source: issue_a, target: issue_c }
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
project.add_guest(user)
gitlab_sign_in(user)
end
......@@ -240,7 +240,7 @@ RSpec.describe 'Related issues', :js do
context 'with related_issues enabled' do
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
end
context 'without existing related issues' do
......
......@@ -75,7 +75,7 @@ RSpec.describe 'Feature flag issue links', :js do
context 'when the related issues feature is unavailable' do
before do
stub_licensed_features(related_issues: false, feature_flags: true)
stub_licensed_features(blocked_issues: false, feature_flags: true)
end
it 'does not show the related issues widget' do
......
......@@ -37,12 +37,8 @@ RSpec.describe ProjectPolicy do
context 'basic permissions' do
include_context 'ProjectPolicy context'
let(:additional_guest_permissions) do
%i[read_issue_link]
end
let(:additional_reporter_permissions) do
%i[read_software_license_policy admin_issue_link]
%i[read_software_license_policy]
end
let(:additional_developer_permissions) do
......
......@@ -8,7 +8,7 @@ RSpec.describe Projects::IssueLinksController do
let(:issue) { create :issue, project: project }
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
end
describe 'GET /*namespace_id/:project_id/issues/:issue_id/links' do
......
......@@ -65,7 +65,7 @@ RSpec.describe Issues::MoveService do
let!(:issue_link_d) { create(:issue_link, source: authorized_issue_d, target: old_issue) }
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
authorized_project.add_developer(user)
authorized_project2.add_developer(user)
end
......
......@@ -334,7 +334,7 @@ RSpec.describe Notes::QuickActionsService do
context 'related issues are not enabled' do
before do
stub_licensed_features(related_issues: false)
stub_licensed_features(blocked_issues: false)
end
it 'does not create issue relation' do
......@@ -344,7 +344,7 @@ RSpec.describe Notes::QuickActionsService do
context 'related issues are enabled' do
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
end
it 'creates issue relation' do
......
......@@ -13,7 +13,7 @@ RSpec.describe IssueLinks::CreateService do
end
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
project.add_developer(user)
end
......
......@@ -9,7 +9,7 @@ RSpec.describe IssueLinks::ListService do
let(:user_role) { :developer }
before do
stub_licensed_features(related_issues: true)
stub_licensed_features(blocked_issues: true)
project.add_role(user, user_role)
end
......
......@@ -20,7 +20,7 @@ RSpec.describe ProjectPolicy do
read_project_for_iids read_issue_iid read_label
read_milestone read_snippet read_project_member read_note
create_project create_issue create_note upload_file create_merge_request_in
award_emoji read_release
award_emoji read_release read_issue_link
]
end
......@@ -30,7 +30,7 @@ RSpec.describe ProjectPolicy do
admin_issue admin_label admin_list read_commit_status read_build
read_container_image read_pipeline read_environment read_deployment
read_merge_request download_wiki_code read_sentry_issue read_metrics_dashboard_annotation
metrics_dashboard read_confidential_issues
metrics_dashboard read_confidential_issues admin_issue_link
]
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