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
mark the link of members in the group representer uncacheable
ulferts6e17dce3149a
diff --git a/lib/api/decorators/linked_resource.rb b/lib/api/decorators/linked_resource.rbindex b76d99deda4..9f8faef2562 100644--- a/lib/api/decorators/linked_resource.rb+++ b/lib/api/decorators/linked_resource.rb@@ -205,6 +205,7 @@ module APIskip_render: ->(*) { false },skip_link: skip_render,link_title_attribute: :name,+ uncacheable_link: false,getter: associated_resources_default_getter(name, representer),setter: associated_resources_default_setter(name, v3_path),link: associated_resources_default_link(name,@@ -216,6 +217,7 @@ module APIgetter:,setter:,link:,+ uncacheable_link:,skip_render:)enddiff --git a/lib/api/v3/groups/group_representer.rb b/lib/api/v3/groups/group_representer.rbindex 2f73ab0b51b..f083f6f35a6 100644--- a/lib/api/v3/groups/group_representer.rb+++ b/lib/api/v3/groups/group_representer.rb@@ -54,7 +54,8 @@ module APIassociated_resources :users,as: :members,- skip_render: -> { !current_user.allowed_to_globally?(:manage_members) }+ skip_render: -> { !current_user.allowed_to_globally?(:manage_members) },+ uncacheable_link: trueendendenddiff --git a/spec/lib/api/v3/groups/group_representer_spec.rb b/spec/lib/api/v3/groups/group_representer_spec.rbindex d1d4a959ae0..233d9aff0f8 100644--- a/spec/lib/api/v3/groups/group_representer_spec.rb+++ b/spec/lib/api/v3/groups/group_representer_spec.rb@@ -84,6 +84,18 @@ describe API::V3::Groups::GroupRepresenter, 'rendering' doit_behaves_like 'has no link'end++ context 'when first having the necessary permissions and then not (caching)' do+ before do+ representer.to_json++ allow(current_user)+ .to receive(:allowed_to_globally?)+ .and_return false+ end++ it_behaves_like 'has no link'+ endenddescribe 'updateImmediately' do