// Constructor
 public ShowUsersViewModel(AppState appState, ICommand containerChangePageCommand)
     : base(appState)
 {
     ContainerChangePageCommand = containerChangePageCommand;
     AuthorizedUserRoles.Add("Administrator");
     Name = "Vis systembrugere";
 }
Example #2
0
        // Hjælpefunktion til autorisering
        public bool IsUserAuthorized(UserDTO user)
        {
            if (AuthorizedUserRoles.Count == 0)
            {
                return(true);
            }

            foreach (string role in user.Roles)
            {
                if (AuthorizedUserRoles.Contains(role))
                {
                    return(true);
                }
            }

            return(false);
        }