fields[$right]; } /** * Init profiles * * @return void */ static function initProfile() { global $DB; $profile = new self(); // Add new rights in glpi_profilerights table foreach ($profile->getAllRights() as $right) { if (!countElementsInTable("glpi_profilerights", ['name' => $right['field']])) { ProfileRight::addProfileRights([$right['field']]); } } } /** * Get all rights * * @return array */ static function getAllRights() { $rights = [ [ 'field' => 'plugin_soc_case', 'name' => __('SOC Case', 'soc'), 'rights' => [ CREATE => __('Create'), READ => __('Read'), UPDATE => __('Update'), DELETE => __('Delete'), PURGE => __('Purge') ] ] ]; return $rights; } /** * Create first access for super-admin user * * @param integer $ID * @return void */ static function createFirstAccess($ID) { $profile = new self(); foreach ($profile->getAllRights() as $right) { self::addDefaultProfileInfos($ID, [$right['field'] => ALLSTANDARDRIGHT]); } } /** * Show profile form * * @param integer $profiles_id * @param boolean $openform * @param boolean $closeform * @return void */ function showForm($profiles_id = 0, $openform = true, $closeform = true) { echo "