diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index 9c0cead28..016a3c9b6 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -130,6 +130,14 @@ abstract class User extends cmdbAbstractObject $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:LoginMustBeUnique', $sNewLogin); } } + // Check that this user has at least one profile assigned + $oSet = $this->Get('profile_list'); + $aProfileLinks = $oSet->ToArray(); + if (count($aProfileLinks) == 0) + { + $this->m_aCheckIssues[] = Dict::Format('Class:User/Error:AtLeastOneProfileIsNeeded'); + } + } function GetGrantAsHtml($sClass, $iAction) @@ -584,10 +592,6 @@ class UserRights } return self::$m_oAddOn->IsStimulusAllowed($oUser, $sClass, $sStimulusCode, $oInstanceSet); } - elseif(($iActionCode == UR_ACTION_READ) && MetaModel::HasCategory($sClass, 'view_in_gui')) - { - return true; - } else { // Other classes could be edited/listed by the administrators