Thread:Project:Support desk/Function to check user rights

what is the function/object to check to see if a user has a right enabled

what i am trying to do is make the siteadmin or my one write call siteowner to be unblockable from the site ipblock-exempt and proxyunbannable only cover ip blocks but i want the user to be immune from username, email etc blocks

i understand php so need to know where in the code i can check for the right and act accordingly

MediaWiki v1.17.0