> For the complete documentation index, see [llms.txt](https://windhoney.gitbook.io/yii2-rest-rbac/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://windhoney.gitbook.io/yii2-rest-rbac/permission/permission-update.md).

# 更新

## **权限-更新**

* 接口名称：权限更新
* 请求方式：post
* 请求示例：[/rbac/permissions/update?id=权限1](https://github.com/windhoney/yii2-rest-rbac/tree/5607a3fc72fd54f761435b601794fd2091885740/%7B%7Bbook.api_url%7D%7D/rbac/permissions/update?id=权限1/README.md)
* 请求参数说明：

| 元素名称        | 数据类型   | 是否非空 | 元素说明 | 备注  |
| ----------- | ------ | ---- | ---- | --- |
| name        | string | 是    | 名称   | --- |
| description | string | 是    | 描述   | --- |
| ruleName    | string | 否    | 规则名称 | --- |
| data        | string | 否    | 数据   | --- |

## **添加示例：**

* 数据格式：数组

  ```php
  {
    "name": "权限1",
    "description": "1",
    "ruleName": "",
    "data": "3"
  }
  ```

  **返回信息：**
* 数据格式：JSON
* 成功示例： 成功 返回更新后的详情

  ```php
  {
    "code": 200,
    "message": "OK",
    "data": [
        {
            "name": "/admin/abc/index1",
            "description": "这是描述12312",
            "ruleName": null,
            "data": null
        },
        {
            "name": "/admin/permission/remove",
            "description": null,
            "ruleName": null,
            "data": null
        },
        {
            "name": "今天测试",
            "description": "1",
            "ruleName": null,
            "data": 3
        }
    ]
  }
  ```
* 失败示例：

  ```php
  { 
    "code": 400, 
    "message": "操作失败",
  }
  ```
