use of ddf.catalog.ftp.user.FtpUser in project ddf by codice.
the class UserManagerImpl method createUser.
/**
* @param userName name of the user being authenticated
* @param subject {@link Subject} of the user
* @return {@link FtpUser}
*/
protected FtpUser createUser(String userName, Subject subject) {
FtpUser user = new FtpUser();
user.setName(userName);
user.setEnabled(true);
user.setHomeDirectory(uploadDirectory);
List<Authority> authorities = new ArrayList<>();
authorities.add(new WritePermission());
authorities.add(new ConcurrentLoginPermission(0, 0));
authorities.add(new TransferRatePermission(0, 0));
user.setAuthorities(authorities);
user.setMaxIdleTime(MAX_IDLE_TIME_SECONDS);
user.setSubject(subject);
setAdmin(user);
save(user);
return user;
}
Aggregations