private void LoadUser() { IsLoggedIn = false; AppUserRole user; using (var ctx = new EpiPlanTool.Context.PlanContext()) { user = ctx.AppUserRoles.Find(UserID.ToLowerInvariant()); } if (user != null) { IsPlanner = user.Roles.HasFlag(RoleFlags.Planner); IsAdmin = user.Roles.HasFlag(RoleFlags.Admin); } }