Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete posts when deleting user #1323

Closed
illori opened this issue Jan 29, 2014 · 10 comments
Closed

delete posts when deleting user #1323

illori opened this issue Jan 29, 2014 · 10 comments

Comments

@illori
Copy link
Contributor

illori commented Jan 29, 2014

we have permissions separate for being able to delete a users account [others] and being able to delete the users posts when you delete the account. i think this is not right.

$context['can_delete_posts'] = !$context['user']['is_owner'] && allowedTo('moderate_forum');

if you can delete posts normally and can also delete an account you should be able to delete the posts along with the account

@Arantor
Copy link
Contributor

Arantor commented Feb 2, 2014

moderate_forum is a strange permission. More accurately it is moderate-forum-members. That's pretty implicitly including the right to delete posts. All the check is saying is that if you're not the user whose account it is (i.e. you can't force-delete your own posts), and you can moderate-forum-members you have the power to delete posts with that.

I'm not sure what actually needs changing here - are you suggesting adding a further permissions test to it to prevent people who can delete accounts from not being able to delete posts unless they can also delete them normally? (This is only realistically an issue in the event of having users who can moderate other users but not actually moderate their posts, which should theoretically be a non issue)

@illori
Copy link
Contributor Author

illori commented Feb 2, 2014

no i mean that if you have already the perm to delete posts [from anyone/anywhere] why can you not check this box if you can delete a users account?

@Arantor
Copy link
Contributor

Arantor commented Feb 2, 2014

So if you present the user the option to delete posts when there is a chance it won't?

Remove posts is a per board permission. As such you cannot remove all posts, only posts in boards that you can delete from, which potentially might mean not all posts.

@illori
Copy link
Contributor Author

illori commented Feb 2, 2014

and if the user has the moderate_forum permission you would not run into that issue as well?

@Oldiesmann
Copy link
Contributor

Technically, yes, but given the kind of power you get with moderate_forum (see hidden users, see users' IP addresses, reply to un-approved posts, etc.), it's highly unlikely someone with that permission wouldn't also have permission to delete posts on the forums.

@Arantor
Copy link
Contributor

Arantor commented Feb 2, 2014

Illori: no, because as I already pointed out delete topics permission is NOT checked here. It is also a global rather than a board permission.

So like I said, what exactly should change?

@illori
Copy link
Contributor Author

illori commented Feb 2, 2014

@Oldiesmann if you have moderate_forum perm it has no effect on replying to unapproved posts

@Arantor i guess there is nothing to change as you dont agree.

the issue came up on the forum where a moderator could delete the users account but could not delete all their posts with the checkbox.

@Arantor
Copy link
Contributor

Arantor commented Feb 2, 2014

The thing is, what you're proposing will NOT change that. If anything it will make it worse because it will intimate that things can be removed when they can't, not to mention a performance hurt in doing it.

If you're saying there's a bug with the deletion process, I'm tempted to agree, but only because what 2.0 does is misleading in terms of what gets removed, which is why it was reworded in 2.1 anyway to make it more clear what would be deleted under what circumstances (but it's still not based on remove-post permissions, or shouldn't be, for all the given reasons)

@live627 live627 modified the milestone: Beta 3 Jul 12, 2015
@jdarwood007
Copy link
Member

@illori
SMF doesn't have logic here to determine if the delete_any applies to all posts. This is noted in the General Permissions page for the Default Board Permissions section where you apply the Delete Any Post permission.

Note: changing these board permissions will affect all boards currently assigned the "Default" permissions profile. Boards not using the "Default" profile will not be affected by changes to this page.

So if we have more than the default profile and they don't have delete any setup for that profile, this check would fail to properly assume they have permissions to delete everywhere. It also isn't possible as well right now for allowedTo to check based on the profile id, only the board id.

This could be looked at for beyond 2.1, but i don't think we have the code or solution setup to do this correctly with the current permissions setup.

@illori
Copy link
Contributor Author

illori commented Jul 15, 2018

then this does not need to be fixed in SMF 2.1.

@illori illori closed this as completed Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants