code: public ORole allow(final String iResource, final int iOperation) {
  		if (roles == null || roles.isEmpty())
  			throw new OSecurityAccessException(document.getDatabase().getName(), "User '" + document.field("name")
  					+ "' has no role defined");
  
  		final ORole role = checkIfAllowed(iResource, iOperation);
  
  		if (role == null)
  			throw new OSecurityAccessException(document.getDatabase().getName(), "User '" + document.field("name")
  					+ "' has no the permission to execute the operation '" + ORole.permissionToString(iOperation)
  					+ "' against the resource: " + iResource);
  
  		return role;
  	}
docs: Checks if the user has the permission to access to the requested resource for the requested operation.
  
  @param iResource
  Requested resource
  @param iOperation
  Requested operation
  @return The role that has granted the permission if any, otherwise a OSecurityAccessException exception is raised
  @exception OSecurityAccessException