@Override @Transactional public void update(net.sourceforge.guacamole.net.auth.User object) throws GuacamoleException { // If user not actually from this auth provider, we can't handle updated // permissions. if (!(object instanceof MySQLUser)) throw new GuacamoleException("User not from database."); MySQLUser mySQLUser = (MySQLUser) object; // Validate permission to update this user is granted permissionCheckService.verifyUserAccess( this.user_id, mySQLUser.getUserID(), MySQLConstants.USER_UPDATE); // Update the user in the database userService.updateUser(mySQLUser); // Update permissions in database createPermissions(mySQLUser.getUserID(), mySQLUser.getNewPermissions()); removePermissions(mySQLUser.getUserID(), mySQLUser.getRemovedPermissions()); // The appropriate permissions have been inserted and deleted, so // reset the new and removed permission sets. mySQLUser.resetPermissions(); }