/// /////////////////////////////////////////////////// public CListeRestrictionsUtilisateurSurType GetListeRestrictions(int?nIdVersion) { CListeRestrictionsUtilisateurSurType liste = new CListeRestrictionsUtilisateurSurType(); CConfigurationRestrictions.AppliqueRestrictions(CTimosServeur.c_keyRestrictionAllUsers, liste); CDonneesActeurUtilisateur user = Utilisateur; //C'est pas une session système if (user != null) { liste.Combine(user.GetRestrictions(nIdVersion)); } liste.Combine(GetListeRestrictionsModulesClient()); CConfigurationRestrictions.AppliqueRestrictions(CTimosServeur.c_keyRestrictionAllUsers, liste); if (UserLicence != null && UserLicence.IsReadOnly) { foreach (Type tp in CContexteDonnee.GetAllTypes()) { CRestrictionUtilisateurSurType rest = liste.GetRestriction(tp); CRestrictionUtilisateurSurType restRO = new CRestrictionUtilisateurSurType(tp); restRO.RestrictionSysteme = ERestriction.ReadOnly; rest.Combine(restRO); liste.AddRestriction(rest); } } return(liste); }
public void ReinitialiserRestrictions(CConfigModulesTimos config) { //CConfigurationRestrictions.ClearRestrictions(); CListeRestrictionsUtilisateurSurType restrictionsModules = CModuleRestrictionProvider.GetRestrictionsApp(config); CConfigurationRestrictions.AjouteRestrictions(CTimosServeur.c_keyRestrictionAllUsers, restrictionsModules); foreach (CSessionClientSurServeur session in CGestionnaireSessionsTimos.ListeSessionsServeur) { if (session is CSessionClientSurServeurTimos) { CSessionClientSurServeurTimos sessionTimos = (CSessionClientSurServeurTimos)session; sessionTimos.SetNewConfigModules(config); } } }
public CRestrictionUtilisateurSurType GetRestrictionsSur(Type tp, int?nIdVersion) { CDonneesActeurUtilisateur user = Utilisateur; CRestrictionUtilisateurSurType rest = null; if (user == null)//C'est une session système { rest = new CRestrictionUtilisateurSurType(tp); } else { rest = user.GetRestrictionsSurType(tp, nIdVersion); } CConfigurationRestrictions.AppliqueRestriction(CTimosServeur.c_keyRestrictionAllUsers, rest); if (m_userLicence != null && m_userLicence.IsReadOnly) { rest.RestrictionUtilisateur |= ERestriction.ReadOnly; } return(rest); }