-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Garrett wrote:
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.
Why should it ignore any errors? This makes no sense to me...
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).
These aren't page actions that you do "to" Special:GlobalBlockList,
they're general actions that you perform in the system.
Also, the wfReadOnly checks are done in
getUserPermissionsErrors, so
we need to add them separately if we are to use User::isAllowed.
Read-only isn't a permission issue, it's a "the system can't handle this
right now" issue.
- -- brion
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAkigbd0ACgkQwRnhpk1wk46HAQCfe7esiwxrNl0UgqJLY2j6XbIj
gJ0An1S3kXEyjJLhpzlFs/Rh3/r++S+I
=Dc1l
-----END PGP SIGNATURE-----