inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 87 forks source link

[revisit/question] Make Access system field depend on active #397

Open fenekku opened 3 years ago

fenekku commented 3 years ago

In order to get things moving, we merged https://github.com/inveniosoftware/invenio-rdm-records/pull/396, but it potentially introduces enough rope to hang ourselves via allowing to save "access.embargo.active" as null on disk.

The Access system field could be made to rely strictly on the API "access.embargo.active" to know if an embargo is active or not and use booleans + strings from then on for the "embargo" subfield. If "access.embargo" == {} or "access.embargo" doesn't even exist, then the in memory system field can be an Access object with self.active = False (see https://en.wikipedia.org/wiki/Null_object_pattern) and on disk we can omit to save "access.embargo" completely. When reading from disk the same rules would apply.

In particular this works with the simplifying premise of disregarding "embargo.until" the moment "embargo.active" is false.

github-actions[bot] commented 3 years ago

This issue was automatically marked as stale.