コード例 #1
0
        public async void AddSelectedRole()
        {
            await userEndpoint.AddUserToRole(SelectedUser.Id, SelectedAvaliableRole);

            UserRoles.Add(SelectedAvaliableRole);
            AvaliableRoles.Remove(SelectedAvaliableRole);
        }
コード例 #2
0
        public async void RemoveSelectedRole()
        {
            await userEndpoint.RemoveUserFromRole(SelectedUser.Id, SelectedUserRole);

            AvaliableRoles.Add(SelectedUserRole);
            UserRoles.Remove(SelectedUserRole);
        }
コード例 #3
0
        private async Task LoadRoles()
        {
            var rolesList = await userEndpoint.GetAllRoles();

            foreach (var role in rolesList)
            {
                if (UserRoles.IndexOf(role.Value) < 0)
                {
                    AvaliableRoles.Add(role.Value);
                }
            }
        }