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 .