3
Here is a snippet out of kernel/user.php Maybe it will help:
/**
* Is the user admin ?
*
* This method will return true if this user has admin rights for the specified module.
* - If you don't specify any module ID, the current module will be checked.
* - If you set the module_id to -1, it will return true if the user has admin rights for at least one module
*
* @param int $module_id check if user is admin of this module
* @return bool is the user admin of that module?
*/
function isAdmin( $module_id = null ) {
if ( is_null( $module_id ) ) {
$module_id = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar( 'mid', 'n' ) : 1;
} elseif ( intval($module_id) < 1 ) {
$module_id = 0;
}
$moduleperm_handler =& xoops_gethandler('groupperm');
return $moduleperm_handler->checkRight('module_admin', $module_id, $this->getGroups());
}