Skip to content

Conversation

@lunika
Copy link
Member

@lunika lunika commented Aug 22, 2025

Purpose

An editor who created a subpages should be allowed to delete it.
We change the abilities to be coherent between the creation and the
deletion.

Proposal

  • 🐛(backend) allow editor to delete subpages

Fixes #1193

@lunika lunika requested review from AntoLC and sampaccoud August 22, 2025 13:00
@lunika lunika self-assigned this Aug 22, 2025
@lunika lunika added the bug Something isn't working label Aug 22, 2025
@sampaccoud
Copy link
Member

Good point as the owner can still restore from trashbin...

Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected, but I find it is lot of power for the editors, I am wondering if an editor should be able to delete only his own subpages.

can_destroy = is_owner or is_admin or is_creator 
@virgile-dev
Copy link
Collaborator

@AntoLC I agree with you ! Let’s go for what you proposed

@lunika lunika force-pushed the fix/editor-can-delete-subpages branch from 4aba797 to c478359 Compare August 28, 2025 16:07
@lunika lunika changed the title 🐛(backend) allow editor to delete subpages 🐛(backend) allow creator to delete subpages Aug 28, 2025
@lunika lunika force-pushed the fix/editor-can-delete-subpages branch from c478359 to c660534 Compare August 28, 2025 16:08
@lunika
Copy link
Member Author

lunika commented Aug 28, 2025

The implementation I made changed a bit. I think it should be reviewed again.
@qbey can you take a look please ? I made some modification on the document queryset, I would like to have your input.

@github-actions
Copy link

github-actions bot commented Aug 28, 2025

Size Change: +5 B (0%)

Total Size: 3.6 MB

compressed-size-action

@lunika lunika requested a review from qbey August 29, 2025 10:29
Comment on lines +767 to +759
is_owner
if self.is_root()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, why admin cannot delete root documents (and I don't see the related test)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunika lunika force-pushed the fix/editor-can-delete-subpages branch 3 times, most recently from b866248 to 14fa6a4 Compare September 1, 2025 15:37
An editor who created a subpages should be allowed to delete it. We change the abilities to be coherent between the creation and the deletion. Fixes #1193
@lunika lunika force-pushed the fix/editor-can-delete-subpages branch from 14fa6a4 to 2e04b63 Compare September 1, 2025 20:44
@lunika lunika merged commit 2e04b63 into main Sep 1, 2025
21 of 22 checks passed
@lunika lunika deleted the fix/editor-can-delete-subpages branch September 1, 2025 20:58
@AntoLC AntoLC mentioned this pull request Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

6 participants