List of usage examples for io.vertx.core.json JsonArray contains
public boolean contains(Object value)
From source file:org.politrons.auth.impl.MongoUser.java
License:Open Source License
/** * Check wether the current user has the given permission * /*w ww. ja va2 s . c o m*/ * @param permission * the permission to be checked * @param resultHandler * resulthandler gets true, if permission is valid, otherwise false * */ protected void doHasPermission(String permission, Handler<AsyncResult<Boolean>> resultHandler) { try { JsonArray userPermissions = principal.getJsonArray(mongoAuth.getPermissionField()); resultHandler.handle( Future.succeededFuture(userPermissions != null && userPermissions.contains(permission))); } catch (Throwable e) { resultHandler.handle(Future.failedFuture(e)); } }