You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We just noticed that users can't delete their own unpublished drafts unless they have the Delete entries permission. I'm not quite sure if this a bug or a feature request – feel free to convert to a discussion if it's working as intended.
Steps to reproduce
Create a user with the following permissions (for any section):
Impersonate the user and create an unpublished draft.
The user can't delete the unpublished draft.
Expected behavior
The view permission gives user's the ability to create drafts. They can also delete their own drafts, but only if they are not the canonical entry. If the draft is canonical (i.e. an unpublished draft without a published canonical entry), they can not delete those drafts.
An unpublished draft is sort of in between published entries and drafts, since they're canonical (like published entries) but only drafts (like non-canonical drafts). So whether deleting them should require only the View permission or also the Delete permission is up for debate.
I would argue that the View permission should suffice to delete your own unpublished draft. The current behaviour is inconsistent, since you can always delete your own non-canonical drafts, but you can't delete unpublished drafts. There's also no way to allow users to delete their own unpublished drafts without also giving them the ability to delete published entries. I know Craft technically doesn't distinguish between unpublished and published anymore, only between draft/non-draft and canonical/non-canonical, but from a user perspective it's a bit inconsistent.
As an alternative, maybe the permission can be split into two permissions, one to delete unpublished drafts and one to delete published entries?
Craft CMS version
4.7.1
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered:
Thanks for pointing that out! Unpublished drafts are meant to mimic forms for new sections/fields/etc., where nothing is actually saved yet, until you submit the form. So it would definitely be expected that a user could delete their own unpublished draft, in the same way that you can just decide to not submit a form for a new section before you’ve saved it.
What happened?
Description
We just noticed that users can't delete their own unpublished drafts unless they have the Delete entries permission. I'm not quite sure if this a bug or a feature request – feel free to convert to a discussion if it's working as intended.
Steps to reproduce
Expected behavior
The view permission gives user's the ability to create drafts. They can also delete their own drafts, but only if they are not the canonical entry. If the draft is canonical (i.e. an unpublished draft without a published canonical entry), they can not delete those drafts.
An unpublished draft is sort of in between published entries and drafts, since they're canonical (like published entries) but only drafts (like non-canonical drafts). So whether deleting them should require only the View permission or also the Delete permission is up for debate.
I would argue that the View permission should suffice to delete your own unpublished draft. The current behaviour is inconsistent, since you can always delete your own non-canonical drafts, but you can't delete unpublished drafts. There's also no way to allow users to delete their own unpublished drafts without also giving them the ability to delete published entries. I know Craft technically doesn't distinguish between unpublished and published anymore, only between draft/non-draft and canonical/non-canonical, but from a user perspective it's a bit inconsistent.
As an alternative, maybe the permission can be split into two permissions, one to delete unpublished drafts and one to delete published entries?
Craft CMS version
4.7.1
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: