Ejemplo n.º 1
0
  public void editEventCreationPrivilege(boolean eventCreationPrivilege)
      throws PrivilegeInsufficientException, DoesNotExistException {

    User loggedInUser = logInManager.getLoggedInUser();
    if (PrivilegeManager.hasAdminPrivilege(loggedInUser)) {
      selectedUser.setEventCreationPrivilege(eventCreationPrivilege);
      usersTable.setLevel(selectedUser.getUserId(), eventCreationPrivilege == true ? 1 : 0);
    }
  }
Ejemplo n.º 2
0
  public void editPhoneNumber(PhoneNumber phoneNumber)
      throws PrivilegeInsufficientException, DoesNotExistException {

    User loggedInUser = logInManager.getLoggedInUser();
    if (PrivilegeManager.hasUserPrivilege(loggedInUser, selectedUser)) {
      selectedUser.setPhoneNumber(phoneNumber);
      usersTable.setPhone(selectedUser.getUserId(), phoneNumber.toString());
    }
  }
Ejemplo n.º 3
0
  public void editAddress(Address address)
      throws PrivilegeInsufficientException, DoesNotExistException {

    User loggedInUser = logInManager.getLoggedInUser();
    if (PrivilegeManager.hasUserPrivilege(loggedInUser, selectedUser)) {
      selectedUser.setAddress(address);
      usersTable.setAddress(selectedUser.getUserId(), address);
    }
  }
Ejemplo n.º 4
0
  public void editLastName(String lastName)
      throws PrivilegeInsufficientException, DoesNotExistException {

    User loggedInUser = logInManager.getLoggedInUser();
    if (PrivilegeManager.hasUserPrivilege(loggedInUser, selectedUser)) {
      selectedUser.setLastName(lastName);
      usersTable.setLastName(selectedUser.getUserId(), lastName);
    }
  }
Ejemplo n.º 5
0
  public void editPassword(String password, String passwordMatch)
      throws IllegalCharacterException, PasswordMismatchError, PrivilegeInsufficientException,
          DoesNotExistException, InvalidKeyException, UnsupportedEncodingException,
          IllegalBlockSizeException, BadPaddingException {

    User loggedInUser = logInManager.getLoggedInUser();
    if (PrivilegeManager.hasUserPrivilege(loggedInUser, selectedUser)) {
      selectedUser.setPassword(password, passwordMatch);
      usersTable.setPwd(selectedUser.getUserId(), password);
    }
  }
Ejemplo n.º 6
0
 public void deleteUser(User user) throws DoesNotExistException {
   userList.remove(selectedUser);
   usersTable.removeUser(selectedUser.getUserId());
 }