/** * Returns true if the internal BE_USER has access to the module $name with $MCONF (based on security level set for that module) * * @param string Module name * @param array MCONF array (module configuration array) from the modules conf.php file (contains settings about what access level the module has) * @return boolean True if access is granted for $this->BE_USER */ function checkModAccess($name, $MCONF) { if ($MCONF['access']) { $access = strtolower($MCONF['access']); // Checking if admin-access is required if (strstr($access, 'admin')) { // If admin-permissions is required then return true if user is admin if ($this->BE_USER->isAdmin()) { return TRUE; } } // This will add modules to the select-lists of user and groups if (strstr($access, 'user')) { $this->modListUser[] = $name; } if (strstr($access, 'group')) { $this->modListGroup[] = $name; } // This checks if a user is permitted to access the module if ($this->BE_USER->isAdmin() || $this->BE_USER->check('modules', $name)) { return TRUE; } // If admin you can always access a module } else { return TRUE; } // If conf[access] is not set, then permission IS granted! }