code/app/be/objectify/deadbolt/java/ViewSupport.java
public boolean viewRestrict(final List<String[]> roles,
                                final DeadboltHandler handler,
                                final Optional<String> content,
                                final long timeoutInMillis,
                                final Http.RequestHeader requestHeader) throws Throwable
    {
        boolean allowed;
        try
        {
            allowed = constraintLogic.restrict(requestHeader,
                                               handler(handler),
                                               content,
                                               () -> roles,
                                               rh -> CompletableFuture.completedFuture(Boolean.TRUE),
                                               (rh, dh, cnt) -> CompletableFuture.completedFuture(Boolean.FALSE),
                                               ConstraintPoint.TEMPLATE)
                                     .toCompletableFuture()
                                     .get(timeoutInMillis,
                                          TimeUnit.MILLISECONDS);

        }
        catch (TimeoutException e)
        {
            allowed = timeoutHandler.apply(timeoutInMillis,
                                           e);
        }
        return allowed;
    }
public boolean viewRestrict(final List<String[]> roles,
                                final DeadboltHandler handler,
                                final Optional<String> content,
                                final long timeoutInMillis,
                                final Http.RequestHeader requestHeader) throws Throwable
    {
        boolean allowed;
        try
        {
            allowed = constraintLogic.restrict(requestHeader,
                                               handler(handler),
                                               content,
                                               () -> roles,
                                               rh -> CompletableFuture.completedFuture(Boolean.TRUE),
                                               (rh, dh, cnt) -> CompletableFuture.completedFuture(Boolean.FALSE),
                                               ConstraintPoint.TEMPLATE)
                                     .toCompletableFuture()
                                     .get(timeoutInMillis,
                                          TimeUnit.MILLISECONDS);

        }
        catch (TimeoutException e)
        {
            allowed = timeoutHandler.apply(timeoutInMillis,
                                           e);
        }
        return allowed;
    }
Used for restrict tags in the template.

@param roles a list of String arrays.  Within an array, the roles are ANDed.  The arrays in the list are OR'd.
@return true if the view can be accessed, otherwise false