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

files: conditional lock and versioning #574

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions docs/customize/dois.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ The OAI-PMH server's metadata format ``oai_datacite`` that allows you to harvest
DATACITE_DATACENTER_SYMBOL = "CERN.INVENIORDM"
```


### Versioning end externally managed DOI

By default, InvenioRDM allows versioning for any DOI type - internally or externally managed. Internally managed DOI is a DOI which is given thanks to InvenioRDM feature which allows us to configure the DOI registration on DataCite (check #Enable DOI registration). The external DOIs are not minted by our instance and in some cases repository manager decides to disallow versioning of records identified by external DOI. To disable versioning for external DOIs you need to set:

```python
RDM_ALLOW_EXTERNAL_DOI_VERSIONING = False
```

## Known issues

- **Restricted records:** DOIs are registered for all records including restricted
Expand Down
35 changes: 35 additions & 0 deletions docs/customize/files-and-versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Files and record versioning

The record versioning feature in InvenioRDM allows for the tracking and management of changes made to records' files over time. With this feature, every time a file of a record is updated, a new version of the record is created, capturing the changes made to the files.

This record versioning system enables researchers, data managers, and administrators to maintain a complete history of changes made to records, providing transparency and accountability in the data management process. Each version of the record includes a timestamp, indicating when the change was made, and the user who made the update.

By utilizing record versioning in InvenioRDM, institutions can maintain a reliable audit trail of all modifications made to records, enhancing data integrity, and contributing to good data management practices. This feature is an essential component of maintaining the accuracy, reproducibility, and long-term accessibility of research data and associated metadata in InvenioRDM.

In some cases repository manager might need to chose to disable the file versioning, for example.

- Storage Space: Record file versioning can result in an accumulation of multiple versions of files, which can consume significant storage space over time. In scenarios where storage resources are limited, disabling file versioning can help conserve storage and reduce costs.

- Simplicity: Some users may prefer a simpler and cleaner file management system without multiple versions of files. By disabling versioning, the system becomes more straightforward to manage, especially for users who do not require version history.

- Security and Privacy concerns: In certain cases, keeping multiple versions of files might pose security or privacy risks. Disabling versioning can help mitigate these risks by ensuring that only the latest version of the file is available, reducing the potential exposure of sensitive or outdated information.

- User Preferences: Some users may find versioning unnecessary for their specific use case and may prefer a file management system without version history. By allowing users to disable file versioning, InvenioRDM offers flexibility to cater to individual preferences.

- Performance: Maintaining version history can impact system performance, especially when handling a large number of files and records. Disabling versioning can help improve system responsiveness and speed, particularly in resource-constrained environments.

In order to provide custom rules of unlocking the file edition without creating a new version, you need to implement a callable which evaluates the conditions to a return a bool variable:

```python
def lock_edit_record_published_files(record):
"""Custom conditions for file bucket lock."""
if record:
is_external_doi = record.get("pids", {}).get("doi", {}).get("provider") == "external"
if is_external_doi:
return False
return True


RDM_LOCK_EDIT_PUBLISHED_FILES = lock_edit_record_published_files
"""Lock editing already published files (enforce record versioning)."""
```
Loading