There is currently only one permission that allows for replacing any files. In some cases, we want to only allow a user to use this feature if they are replacing their own file.
Thoughts? Mods?
| Comment | File | Size | Author |
|---|---|---|---|
| add_permission_for_own_files.patch | 1.72 KB | johnsicili |
Comments
Comment #2
casey commentedInteresting, we would need a update path however.
Comment #3
kyilmaz80 commentedHello and thanks for adding this feature,
I tested the new patch on Drupal 10.2.5 and Php 8.2.7. The access logic did not worked as expected. The code below have to be changed:
$is_owner = (bool) $account->id() == $file->getOwnerId();to
$is_owner = $account->id() == $file->getOwnerId();bool cast have a problem i think. Overall the patch worked after that. I am also adding the revised patch (add_permission_for_own_files-r1-240429.patch).
Best regards,
-Koray
Comment #4
kyilmaz80 commentedComment #5
kyilmaz80 commentedComment #6
kyilmaz80 commented