# Securing Views

You can also use our handy `event.secureView()` method in the request context to pivot between views according to user permissions.

{% hint style="info" %}
cbSecurity injects the `secureView()` method into the request context via the `preProcess` interception point.
{% endhint %}

```javascript
event.secureView( permissions, successView, failView )
```

This will allow you to set the `successView` if the user has the permissions or the `failView` if they don't.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coldbox-security.ortusbooks.com/usage/cbsecurity-model/securing-views.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
