Closed schwemmer closed 8 months ago
Statamic doesn't automatically set the "Author" field when a super user creates/edits entries. This is intentional so when a super user edits another author's entry, they don't take over the entry from the original author.
However, super users are able to edit the "Author" field so they could assign themselves as the author of the entry.
^ Although, make sure the "Visibility" of the author field is set to "Visible". Statamic will handle adjusting the visibility based on user permissions.
If you don't need any of the author permissions magic, change the handle of the users field to something else and set the value in a listener based on the currently authenticated user.
PS. To add to that, you can read more about how Statamic handles the reserved author
field here:
Thank you for your explanations.
Bug description
I have a Collection named "Publications" and a role "Publication Editor" who can only create, edit and delete their own "Publications". For this, I added a field "Relationship > Users" and called the handle "author" and the label "Created by".
The id of the user that created the entry was only added to the flat file when I created a new entry as a "Publication Editor" but not when creating it as a super admin.
When I add an entry as Publication Editor, it gets an id and "updated_by" of that user in the flat file, as expected. When I then edit it as a super admin, the "updated_by" changes to my id, as expected. When I then edit it again as "Publication Editor", it does not update the "updated_by" field to their id (not expected)
When I set the visibility of the "author" field to "hidden" in the blueprint, the field is not shown for super admins, as expected, but the field is shown as "read only" when impersonating a Publication Editor (not expected).
How to reproduce
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
runtime (new)
Additional details
No response