Skip to content

Commit

Permalink
customize: update files locking function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
slint authored May 21, 2024
1 parent 2d132a9 commit bdbf3f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/customize/files-and-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ In some cases repository manager might need to chose to disable the file version

- 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:
In order to provide custom rules for unlocking the file edition without creating a new version, you need to implement a callable which evaluates the conditions to return a bool value:

```python
def lock_edit_record_published_files(record):
def lock_edit_record_published_files(service, identity, record=None, draft=None):
"""Custom conditions for file bucket lock."""
if record:
is_external_doi = record.get("pids", {}).get("doi", {}).get("provider") == "external"
Expand All @@ -32,4 +32,4 @@ def lock_edit_record_published_files(record):

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

0 comments on commit bdbf3f0

Please sign in to comment.