Jump to content

Topic on Project:Support desk

Question regarding the Bigdelete permission

5
C.Syde65 (talkcontribs)

For weeks now, I've been trying to find the answer to my question as to whether or not the (bigdelete) permission can be used to delete pages with large histories without the (delete) permission. Obviously users would no longer be able to delete pages that don't have more than a certain number of revisions. But would that mean that they would no longer be able to delete pages with large histories?

Judging by how certain other permissions that delete stuff work, I'm guessing the answer to that would be "yes". Since I've done some tests on some of the permissions. (nuke) requires (delete) to work or it lets users access the page but doesn't let them delete the requested pages. Only permissions like (deleterevision) and (commentadmin) which are both completely unrelated to (delete) are capable of working without the (delete) permission.

I would test this out for myself, but I only have access to (bigdelete) on one site, and I also have (delete) on that site. However I don't have any permission that allows me to modify the permissions of usergroups. So I'm afraid I can't answer this question myself. I'm sorry if this topic doesn't seem like it belongs here, but I was really hoping someone here could answer the question, since I wanted to add the research to a page that I'm writing about various usergroup permissions, and what parent permissions are needed for those certain permissions to work.

Bawolff (talkcontribs)

You need both delete & bigdelete to delete big pages. If you don't have delete, bigdelete does nothing. (If you want to look in code, PermissionManager::checkQuickPermissions which looks at delete rights, happens before PermissionsManager::checkActionPermissions which checks bigdelete. If you don't have delete, the code will never get to the part that checks bigdelete)

C.Syde65 (talkcontribs)

@Bawolff - So how do I do the following? Since I'm not very clear on how to perform this correctly:

(If you want to look in code, PermissionManager::checkQuickPermissions which looks at delete rights, happens before PermissionsManager::checkActionPermissions which checks bigdelete. If you don't have delete, the code will never get to the part that checks bigdelete)

Also once I know how to do this correctly, will this help me to answer my own questions regarding certain other permissions? Because I have a feeling I'm going to be needing answers to similar questions regarding certain other permissions in the future.

Bawolff (talkcontribs)

There may be a bit of a learning curve if you're new to PHP, for doing this. Anyways, the permission checks happen at https://github.com/wikimedia/mediawiki/blob/master/includes/Permissions/PermissionManager.php#L355-L409 . Near the bottom of that function there is a list of what specific checks to run, which are run in order.

If you look in checkQuickPermissions, near the bottom is https://github.com/wikimedia/mediawiki/blob/master/includes/Permissions/PermissionManager.php#L801 $this->userHasRight( $user, $action ) in the delete case, this is checking if the user is in a group that has the delete right.

Later on, we come to checkActionPermissions https://github.com/wikimedia/mediawiki/blob/master/includes/Permissions/PermissionManager.php#L979-L993 This will check when checking if the user can delete, if the page being deleted is big, and if so start the whole process over, but for the bigdelete right instead of delete right.

Thus, if the user can't delete, you get an error that happens before checking the bigdelete right [It may still check bigdelete so that the error message might be adjusted to mention you need both]

C.Syde65 (talkcontribs)

@Bawolff There's a few other permissions that I've been wanting to know if they can work on their own, or if they require another permission to work. On the left hand side are the permissions that I've been wanting to know if they can work on their own, and on the right are the permissions that I suspect are required in order for them to work.

(collectionsaveascommunitypage) = (edit)
(collectionsaveasuserpage) = (edit)
(editrestrictedfields) = (edit)
(multipageedit) = (edit)
(rateimage) = (edit)
(suppressrevision) = (deleterevision) and possibly (deletelogentry)

Reply to "Question regarding the Bigdelete permission"