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

Refactor Default Visibility #1468

Merged
merged 3 commits into from
Dec 16, 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
3 changes: 2 additions & 1 deletion app/jobs/setup_metadata_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def perform(parent_object, current_batch_process, current_batch_connection = par
return
end

if (parent_object.visibility == 'Open with Permission' && parent_object.permission_set_id.nil?) || (parent_object.authoritative_json&.[]('itemPermission') == 'Open with Permission' && parent_object.permission_set_id.nil?) || (parent_object.authoritative_json&.[]('itemPermission') == 'Open With Permission' && parent_object.permission_set_id.nil?)
# TODO: comment in second conditional once Open with Permission objects can go live in production
if parent_object.visibility == 'Open with Permission' && parent_object.permission_set_id.nil? # || (parent_object.authoritative_json&.[]('itemPermission') == 'Open with Permission' && parent_object.permission_set_id.nil?)
permission_set = OpenWithPermission::PermissionSet.find_by(key: parent_object.permission_set&.key)
if permission_set.nil?
parent_object.processing_event("SetupMetadataJob failed. Permission Set information missing or nonexistent from CSV. To successfully ingest a Permission Set Key value must be present for any parent objects that have 'Open with Permission' visibility. Parent Object has defaulted to private and no child objects were created. Please delete parent object and re-attempt ingest with Permission Set Key and Visibility values in CSV.", 'failed')
Expand Down