Page MenuHomePhabricator

userCan hook for 'delete' needed
Closed, ResolvedPublic

Description

Author: b

Description:
I would like custom handling of permissions for page deletions. There are
userCan hooks for 'read', 'edit', 'move', 'create' but not for 'delete'.

Currently various places check for $wgUser->isAllowed('delete') to decide
whether to display the 'delete'/'undelete' tabs or links, or to decide whether
to allow the deletion action. Most of these checks could be replaced with calls
to $this->mTitle->userCanDelete().

The new userCanDelete function in Title.php would be:

function userCanDelete() {

		return $this->userCan('delete');

}

Easy?!


Version: unspecified
Severity: enhancement

Details

Reference
bz7027

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:23 PM
bzimport set Reference to bz7027.
bzimport added a subscriber: Unknown Object (MLST).

mediazilla wrote:

I would suggest extending your proposal to cover other rights that could benefit
from a namespace level scope; e.g. patrol, protect, rollback, hiderevision,
deleterevision.

I am probably forgetting some of course.

[user:jldupont]