use of org.bimserver.database.actions.GetAllNonAuthorizedUsersOfProjectDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllNonAuthorizedUsersOfProject.
public List<SUser> getAllNonAuthorizedUsersOfProject(Long poid) throws ServerException, UserException {
requireRealUserAuthentication();
if (getBimServer().getServerSettingsCache().getServerSettings().getHideUserListForNonAdmin()) {
if (getCurrentUser().getUserType() != SUserType.ADMIN) {
throw new UserException("Admin rights required to list users");
}
}
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Set<User>> action = new GetAllNonAuthorizedUsersOfProjectDatabaseAction(session, getInternalAccessMethod(), poid);
return new ArrayList<SUser>(getBimServer().getSConverter().convertToSSetUser((session.executeAndCommitAction(action))));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations