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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
adapt permission for wp custom field visibility check
ulferts67f3b2533c26
diff --git a/app/models/work_package_custom_field.rb b/app/models/work_package_custom_field.rbindex 6cebb078611..dae6593ec45 100644--- a/app/models/work_package_custom_field.rb+++ b/app/models/work_package_custom_field.rb@@ -39,7 +39,7 @@ class WorkPackageCustomField < CustomFieldthrough: :work_package_custom_valuesscope :visible_by_user, ->(user) {- if user.allowed_to_globally?(:edit_projects)+ if user.allowed_to_globally?(:select_custom_fields)allelsewhere(projects: { id: Project.visible(user) })diff --git a/spec/models/attribute_help_text/work_package_spec.rb b/spec/models/attribute_help_text/work_package_spec.rbindex 8a193b330b8..4602a1ef321 100644--- a/spec/models/attribute_help_text/work_package_spec.rb+++ b/spec/models/attribute_help_text/work_package_spec.rb@@ -96,8 +96,8 @@ describe AttributeHelpText::WorkPackage, type: :model doendend- context 'user having the `edit_projects` permission' do- let(:permissions) { [:edit_projects] }+ context 'user having the `select_custom_fields` permission' do+ let(:permissions) { [:select_custom_fields] }it 'returns the help text for the static and cf attribute' dois_expected