private void UpdateVisibility() { if (LoggedInUserType.HasFlag(RequiredUserType)) { AssociatedObject.Visibility = Visibility.Visible; AssociatedObject.IsEnabled = true; } else { AssociatedObject.Visibility = Visibility.Collapsed; AssociatedObject.IsEnabled = false; } }
public static AuthorizationPolicyBuilder RequireUserType(this AuthorizationPolicyBuilder builder, LoggedInUserType type) { builder.AddRequirements(new StudentRequirement(type)); return(builder); }
public StudentRequirement(LoggedInUserType loggedInAs) { LoggedInAs = loggedInAs; }