Beispiel #1
0
 /// <summary>
 /// Add a new User object to the database
 /// </summary>
 /// <param name="username">Name of the user</param>
 /// <param name="plainPassword">Password in plain text</param>
 /// <param name="role">Role of the user</param>
 public bool CreateUser(string username, string plainPassword, Entities.UserRole role)
 {
     if (!checkUsername(username) && plainPassword.Any())
     {
         allUsers.Add(new User(username, Base64Encode(plainPassword), role));
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public User(string name, string password, Entities.UserRole role)
 {
     Name     = name;
     Password = password;
     Role     = role;
 }
Beispiel #3
0
 /// <summary>
 /// Get a list of users with a specified role
 /// </summary>
 /// <param name="role">Role the user must have</param>
 /// <returns>List of users with a specified role</returns>
 public IEnumerable <User> GetUsersFromRole(Entities.UserRole role) => allUsers.Where(x => x.Role == role);
Beispiel #4
0
 public void Delete(Entities.UserRole entity)
 {
     throw new NotImplementedException();
 }