Closed franksc closed 9 years ago
@franksc, just to give you an update: I am investigating if https://github.com/modc08/mytardis/blob/modc08/tardis/tardis_portal/models/experiment.py#L46 can be used for this purpose. If this is not a solution, we may have to consider to add a switch. Feel free to correct me and make suggestions.
A possible solution:
What do you think, @franksc ?
@Li-ReDBox I don't think that is going to work because:
Here is a hacky solution that seems to work:
def share(request, experiment_id)
:if experiment.public_access == Experiment.PUBLIC_ACCESS_METADATA:
c['has_publicmd'] = True
And in tardis/tardis_portal/templates/tardis_portal/ajax/share.html L559:
{% if is_owner and has_change_permissions or has_publicmd %}
So, show the 'Change Public Access' button if we can change experiment (i.e. it isn't immutable) or we know it is published metadata-only.
Better ideas welcome ...
@franksc this looks better because it sets locked once an experiment is minted which complies better to minting rules. After minted, user is only allowed to change from md -> full no other direction. I will give it a go and see how it works.
@franksc I followed your suggestions and made template checks of public_access_metedata which is straight forward. Then I messed around to remove access_none choice on server side when access is metedata only to stop going back. But found it was not as easy as doing it on front using js. Please check commit and feel free to criticise. Thanks.
Works for me @Li-ReDBox – after you take an experiment from private -> public (md) the Change Public Access button is still displayed but the private option is no longer available, and on switching to public (everything) Change Public Access disappears. :+1:
I am not sure but I reckon this probably the original behaviour but we made it more strict if this is a good word to put it.
A desirable data publication workflow is:
Or to put it another way: you can move an experiment's visibility status forwards (private -> public md only -> public), but not backwards.
However with the current functionality:
@Li-ReDBox can you please suggest how we might implement the desired behaviour as described above? Seems fiddly.