Ejemplo n.º 1
0
        public static bool IsValidAccessToEntity(String EntityName, RightRelatedService ServiceName)
        {
            string roles = Helpers.SessionHelpers.GetRoles(HttpContext.Current.Session);

            if (string.IsNullOrEmpty(roles)) //to avoid check all access and then redirect to login page we check it in frist step
            {
                new global::AccessManagementService.Access.Login().LogOutUser();
                return(false);
            }
            else
            {
                return(global::AccessManagementService.Access.AccessControl.IsValidAccessToEntity(EntityName, (global::AccessManagementService.Access.RightRelatedService)ServiceName, roles));
            }
        }
Ejemplo n.º 2
0
        public static bool IsValidAccessToEntity(String EntityName, RightRelatedService ServiceName, string UserRoles)
        {
            string ASCService = string.Format("{0}_{1}_{2}", "ASC", EntityName, ServiceName.ToString());    //store session value
            Entity entity     = new Entity();

            if (HttpContext.Current.Session[ASCService] != null)
            {
                return((bool)HttpContext.Current.Session[ASCService]);
            }
            else
            {
                string roles = UserRoles;
                if (string.IsNullOrEmpty(roles))
                {
                    return(false);
                }
                var t = entity.ValidEntity_Right(roles, ServiceName.GetAttributeOfType <DescriptionAttribute>().Description, EntityName);
                HttpContext.Current.Session[ASCService] = t;
                return(t);
            }
        }
Ejemplo n.º 3
0
 public static bool IsValidAccessToEntity(String EntityName, RightRelatedService ServiceName)
 {
     return(IsValidAccessToEntity(EntityName, ServiceName, LoggedInUser.UserRoles));
 }