concept access in category hapi

appears as: ccess
hapi.js in Action

This is an excerpt from Manning's book hapi.js in Action.

Every time you create a route, you will also specify a handler. Handlers are the way you tell hapi how it should respond to an HTTP request. A handler can take several forms. The most flexible handler is defined as a JavaScript function with access to a request object and a reply interface. You can examine the request object to get details about the request. You can then use the reply interface to respond to the request however you want. For example, you might respond with an image file or a JSON response to an API request.

Figure 9.3. A user’s scope(s) must intersect with a resource’s scope(s) to be allowed access.