try {
return executeWithBroker(new BrokerOperation<Account[]>(){
@Override
public Account[] withBroker(DBBroker broker) throws XMLDBException, LockException, PermissionDeniedException, IOException, EXistException, TriggerException, SyntaxException {
final SecurityManager sm = broker.getBrokerPool().getSecurityManager();
final java.util.Collection<Account> users = sm.getUsers();
return users.toArray(new Account[users.size()]);
}
});
} catch(final Exception e) {
throw new XMLDBException(ErrorCodes.VENDOR_ERROR, e.getMessage(), e);