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

🐛 User couldn't edit file sets #1016

Merged
merged 1 commit into from
Apr 19, 2024
Merged
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
12 changes: 10 additions & 2 deletions app/helpers/hyku_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ def admin_only_tenant_creation?
end

def parent_path(parent_doc)
model = parent_doc['has_model_ssim'].first
path = "hyrax_#{model.underscore}_path"
model = case parent_doc
when ActiveFedora::Base
parent_doc
when SolrDocument
parent_doc['has_model_ssim'].first.constantize
else
raise "Unknown parent_doc type: #{parent_doc.class}"
end

path = "#{model.model_name.singular_route_key}_path"
main_app.send(path, parent_doc.id)
end
end
Loading