@ Override public boolean canAccess ( ResourceField field , HttpMethod method , QueryContext queryContext , boolean allowIgnore ) { if ( field == null ) { return true ; } FilterBehavior filterBehavior = get ( field , method , queryContext ) ; if ( filterBehavior == FilterBehavior . NONE ) { return true ; } else if ( filterBehavior == FilterBehavior . FORBIDDEN || ! allowIgnore ) { String resourceType = field . getParentResourceInformation ( ) . getResourceType ( ) ; throw new ForbiddenException ( "field '" + resourceType + "." + field . getJsonName ( ) + "' cannot be accessed for " + method ) ; } else { LOGGER . debug ( "ignoring field {}" , field . getUnderlyingName ( ) ) ; PreconditionUtil . verifyEquals ( FilterBehavior . IGNORED , filterBehavior , "unknown behavior" ) ; return false ; } }
Allows to check whether the given field can be written .