# 权限验证

框架中提供了一套完整的权限验证逻辑，可对路由下所有`method`进行权限验证&#x20;

用户需要在入口处（index.php）中添加权限验证配置，具体如下：

```
// APP信息
$app_config = [
    'session_start'  => true,                               // 是否启用session
    'check_purview_handle' => ['model\mod_auth', 'auth'],   // 权限检查
    'menu_file'  => 'menu.xml',                             // 获取菜单和用户权限配置
];
kali::registry( $app_config );
```


---

# 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://doc.kaliphp.com/auth-check.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.
