/** * Returns an array of role_id => role_type of all the roles defined * * @return array */ static function getRoles() { $oConfig = PPI_Helper::getConfig(); if (isset($oConfig->user->roleMappingService) && $oConfig->user->roleMappingService == 'database') { $oUser = new APP_Model_User_Role(); $aRoles = $oUser->getList()->fetchAll(); $aRetRoles = array(); foreach ($aRoles as $aRole) { $aRetRoles[$aRole['name']] = $aRole['id']; } return $aRetRoles; } else { return $oConfig->system->roleMapping->toArray(); } }
/** * Display a user role list * */ protected function userRoleList(array $p_aOptions = array()) { $bReadOnly = isset($p_aOptions['bReadOnly']) && $p_aOptions['bReadOnly'] === true; $oRole = new APP_Model_User_Role(); $aRoles = PPI_Helper_User::getRoles(); $aRoleCounts = $oRole->getRoleCounts(); $this->adminLoad('admin/roles_list', compact('aRoles', 'bReadOnly', 'aRoleCounts')); }