Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix: Add permission to view BCF issues

Wieland Lindenthal4c347ddbb3ee
diff --git a/modules/bcf/lib/open_project/bcf/engine.rb b/modules/bcf/lib/open_project/bcf/engine.rb
index d1b5dd4bff5..f6567344e7e 100644
--- a/modules/bcf/lib/open_project/bcf/engine.rb
+++ b/modules/bcf/lib/open_project/bcf/engine.rb
@@ -70,6 +70,7 @@ module OpenProject::Bcf
patches %i[WorkPackage Type Journal]
patch_with_namespace :BasicData, :SettingSeeder
+ patch_with_namespace :BasicData, :RoleSeeder
patch_with_namespace :API, :V3, :Activities, :ActivityRepresenter
patch_with_namespace :Journal, :AggregatedJournal
patch_with_namespace :API, :V3, :Activities, :ActivitiesSharedHelpers
diff --git a/modules/bcf/lib/open_project/bcf/patches/role_seeder_patch.rb b/modules/bcf/lib/open_project/bcf/patches/role_seeder_patch.rb
new file mode 100644
index 00000000000..01380974c02
--- /dev/null
+++ b/modules/bcf/lib/open_project/bcf/patches/role_seeder_patch.rb
@@ -0,0 +1,35 @@
+module OpenProject::Bcf::Patches::RoleSeederPatch
+ def self.included(base) # :nodoc:
+ base.prepend InstanceMethods
+ end
+
+ module InstanceMethods
+ def member
+ role_attributes = super
+ role_attributes[:permissions] = role_attributes[:permissions] + %i[view_linked_issues manage_bcf]
+
+ role_attributes
+ end
+
+ def reader
+ role_attributes = super
+ role_attributes[:permissions] = role_attributes[:permissions] + %i[view_linked_issues]
+
+ role_attributes
+ end
+
+ def non_member
+ role_attributes = super
+ role_attributes[:permissions] = role_attributes[:permissions] + %i[view_linked_issues]
+
+ role_attributes
+ end
+
+ def anonymous
+ role_attributes = super
+ role_attributes[:permissions] = role_attributes[:permissions] + %i[view_linked_issues]
+
+ role_attributes
+ end
+ end
+end