Esempio n. 1
0
 private void SetViewMode(int?datasetId)
 {
     if (datasetId.HasValue)
     {
         DiseaseController dc = new DiseaseController();
         var datasetDisease   = dc.GetDiseaseAttributeValue(Dataset.DatasetId, datasetId.Value.ToString());
         if (datasetDisease != null)
         {
             var disease = new Disease();
             disease.Get((int)datasetDisease[DiseaseAttributeValue.DiseaseId]);
             Caisis.Security.CustomPrincipal cp = System.Threading.Thread.CurrentPrincipal as Caisis.Security.CustomPrincipal;
             string diseaseView = disease[Disease.DiseaseName].ToString();
             cp.UserProfile["diseaseView"] = diseaseView;
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Validates user has permissions to do the operation
        /// </summary>
        /// <param name="permissionName">permission</param>
        /// <returns>true/false</returns>
        public static bool HasPermission(string permissionName)
        {
            CustomPrincipal p = System.Threading.Thread.CurrentPrincipal as CustomPrincipal;

            return(p.IsInRoles(permissionName));
        }
Esempio n. 3
0
        /// <summary>
        /// Returns the current view mode from clients cookie. Should be called to encapsulate logic
        /// </summary>
        /// <returns></returns>
        public string GetViewMode()
        {
            CustomPrincipal cp = System.Threading.Thread.CurrentPrincipal as CustomPrincipal;

            return(cp.UserProfile["diseaseView"].ToString());
        }