Simetrical schreef:
I think you want $userrights->userCanExecute(
$wgUser ). In fact,
that's the generic way to check for permissions on special pages,
although in all other cases I know of it just falls back to
User::isAllowed.
The catch is that you'll have to instantiate a SpecialPage object,
although you won't actually be visiting the special page. It looks
like it should work, from reading the code, although you might want to
initialize UserrightsPage::$isself to true rather than false.
Alternatively, you
can do @UserrightsPage::userCanExecute($wgUser); (the
@ is necessary to suppress the E_NOTICE about calling a non-static
function statically) and pray userCanExecute() doesn't dereference $this.
Roan Kattouw (Catrope)