On Mon, Aug 11, 2008 at 7:50 AM, <brion(a)svn.wikimedia.org> wrote:
> * Clean up horrible horrible permission checks which are 1000 times more complicated than they should be. We have User::isAllowed() for a reason, kids :)
I've since fixed up the getUserPermissionsErrors function to allow an
array of errors to be ignored to be passed.
It seems like a good idea to prevent blocked users from globally
blocking, and to allow extensions / other code to prevent doing action
X on title Y. This is why I prefer to use getUserPermissionsErrors
rather than isAllowed, since isAllowed only checks if the user has the
appropriate permission (this is the point of getUserPermissionsErrors
- to be a one-stop shop for checking permissions).
Also, the wfReadOnly checks are done in getUserPermissionsErrors, so
we need to add them separately if we are to use User::isAllowed.
--
Andrew Garrett