/// User page visibility
///
/// @author Pierre HUBERT

enum UserPageVisibility { PRIVATE, PUBLIC, OPEN }

/// Find the visibility level matching a string
UserPageVisibility userPageVisibilityFromString(String str) {
  for (int i = 0; i < UserPageVisibility.values.length; i++)
    if (UserPageVisibility.values[i].toString() == str)
      return UserPageVisibility.values[i];

  throw "$str is not a valid user page visibility level!";
}