There are some extensions that implement similar things:
https://www.mediawiki.org/wiki/Extension:RightFunctions
https://www.mediawiki.org/wiki/Extension:UserFunctions
I haven't used either of them, but it looks like they both can do this job.
--
Bartosz Dziewoński