Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow previewing on meeting contents #14994

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/api/v3/render/render_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RenderAPI < ::API::OpenProjectAPI

resources :render do
helpers do
SUPPORTED_CONTEXT_NAMESPACES ||= %w(work_packages projects news posts wiki_pages).freeze
SUPPORTED_CONTEXT_NAMESPACES ||= %w(work_packages projects news posts wiki_pages meeting_contents).freeze
SUPPORTED_MEDIA_TYPE ||= 'text/plain'.freeze

def allowed_content_types
Expand Down
6 changes: 6 additions & 0 deletions modules/meeting/app/models/meeting_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class MeetingContent < ApplicationRecord
title: Proc.new { |o| "#{o.class.model_name.human}: #{o.meeting.title}" },
url: Proc.new { |o| { controller: '/meetings', action: 'show', id: o.meeting } }

scope :visible, ->(*args) {
includes(meeting: :project)
.references(:projects)
.merge(Project.allowed_to(args.first || User.current, :view_meetings))
}

def editable?
true
end
Expand Down
Loading