flarum / issue-archive

0 stars 0 forks source link

Add allow post deletion permission #222

Open matteocontrini opened 4 years ago

matteocontrini commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe.

Currently, users can delete posts they created without a time limit. It would be great to have a new permission to stop users from deleting their own posts, similarly to what is already possible with post editing.

Note: this is different from the moderation permission "canHide", that is thought for moderators groups.

Describe the solution you'd like

It would be very similar to the "Allow post editing" permission, where you can choose a time limit.

immagine

Justify why this feature belongs in Flarum's core, rather than in a third-party extension

It seems quite a basic permission.

I have a problem on my forum where users sometimes get offended, for some reasons, and they start deleting all their posts, which is definitely unideal. I'd like to stop them from being able to wipe everything...

Thanks

tankerkiller125 commented 4 years ago

Allow post editing is currently the permission that allows users to delete their own post I believe, are you trying to allow editing indefinitely but not deletion of post? If that is the case then couldn't your users just replace the content of their post with a single character/nothing and basically get the same result as deleting?

matteocontrini commented 4 years ago

I didn't know it's the same permission, thanks.

are you trying to allow editing indefinitely but not deletion of post?

Yes

If that is the case then couldn't your users just replace the content of their post with a single character/nothing and basically get the same result as deleting?

Yes, but with a lot more effort. No sane user would go through all of its posts, edit each of them and remove the content, while deleting the posts is easier and it's something that has happened on my forum more than once.

Anyway, for my particular use case I think that configuring the "allow post editing" permission is a good compromise. This can still be a feature suggestion for separating the permissions though.

luceos commented 4 years ago

I think this proposal makes sense. However one of the options should be never in addition to the ones from the edit permission.

Yalfoosh commented 4 years ago

Might implement it this weekend (have some other things planned so unsure if I'll make it). I'm having an issue where my users deliberately delete questions they deem stupid, which I initially sort of tried to fix by making editing possible only for 10 minutes. In the future I will develop an extension which allows the administrator to define a set of rules for edits to address the issue @tankerkiller125 mentioned - more on that when I get some time to make it. But for now, I would really need the ability to prevent post deletion.

Are there any other things aside from the proposal from @luceos I should keep in mind?

askvortsov1 commented 4 years ago

I think this sounds rational, go for it!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

matteocontrini commented 4 years ago

@Yalfoosh did you have a chance to take a look at this then?

Yalfoosh commented 4 years ago

@Yalfoosh did you have a chance to take a look at this then?

I did some testing with hotswapped code initially to see how things would change on my forum. Users that deleted questions started editing them out, leaving dots and generally informationless posts behind. I concluded that before I developed a full system that fixes the shortcomings of the editing and deleting posts mechanisms present it would not be worth implementing something that users could just avoid. We'd actually be worse off, because deleted content you can undo, edited content you cannot (without an extension).

So, my thoughts on this months ago when I thought it could be fixed in a matter of hours is that the semantics of deleting a post go way beyond pressing the delete button and that for meaningful delete permissions the whole act of deleting should be redefined to something like "destroying information". But that would mean that we either needed a change in Core or an extension that would consider data destruction via edits as deleting too. For a few months now I have been developing something else that has priority and needs to be finished before autumn.

Then the next thing will be a graphical update for my forum, for sure. After that it's probably going to be a system that encompases the detection of data deletion, but is more like a general purpose "content classification" system, with the focus on combatting spam, toxicity and vulgarity. Which means it's likely not to come out until at least next year, but probably even not in a year, because of the scope of the whole project.

matteocontrini commented 4 years ago

@Yalfoosh thanks for your efforts!

I think however that this issue is simply about splitting that permission, so that a forum admin can at least choose the settings they prefer (and possibly for different reasons from the ones we've mentioned so far). Anything more complex than that would probably be more suitable as an extension.

I would do this and send a PR if I knew what to touch... :)

Yalfoosh commented 4 years ago

@matteocontrini Well while I think it should be separated, I feel like deleting should just be a more extreme case of editing, so they should still be in the same category. Otherwise edits will be able to simulate deletion, and deletion + posting again are going to be a workaround for disabled editing. There wouldn't be a problem if features like these weren't there because of your users' stubbornness.

Anyways if you wanna implement it yourself, I believe you should start looking at these files:

https://github.com/flarum/core/blob/d492579638fb52dafbfe65f1f36a95eb6047f7f3/src/Post/PostPolicy.php https://github.com/flarum/core/blob/1592cd1013f2307e882267ebc179474164d3a0fd/js/src/admin/components/PermissionGrid.js https://github.com/flarum/core/blob/d492579638fb52dafbfe65f1f36a95eb6047f7f3/src/Install/Steps/WriteSettings.php

Most of the work is disentangling deletion from editing.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

stale[bot] commented 3 years ago

We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it.

matteocontrini commented 3 years ago

Still needed IMO.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!