-
Notifications
You must be signed in to change notification settings - Fork 52
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
Sample Type and download permissions #2085
Conversation
also a only once task to fix the previously updated permissions
def self.supports_extended_metadata? | ||
false | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question. Does it support Extended Metadata now? Or is it not necessary anymore because it's an asset now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SampleTypes don't support EM. I didn't add this by the way, but just moved up the class out of the private area so I could group these overrides together
SampleType.includes(:policy).where.not(policy_id: nil).each do |sample_type| | ||
policy = sample_type.policy | ||
if policy.access_type == Policy::VISIBLE | ||
policy.update_column(:access_type, Policy::ACCESSIBLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again a question. Does a sample type need to be accessible in order to be able to download the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because it goes throught the content blob controller it checks the permissions on the associated asset. There is an example here: https://testing.sysmo-db.org/sample_types/97
Override methods to prevent sample types being treated as a downloadable asset. This means it behaves more like Samples, Investigation, Studies and Assays, and the permission options don't include a Download option (however, the ACCESSIBLE access type is applied).
Also updated the upgrade task to apply ACCESSIBLE instead of VIEWABLE, and a new task to update the previously applied permissions.
Although unlikely to be the case, the Download template option isn't shown if viewable but not accessible.