- Enforce users to be created with at least one profile

SVN:trunk[867]
This commit is contained in:
Denis Flaven
2010-09-14 09:09:36 +00:00
parent faed087790
commit b124e94551

View File

@@ -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