Skip to content

RESTful API For Role

Echo edited this page Mar 29, 2018 · 7 revisions
获取指定角色信息
Request
GET /saltshaker/api/v1.0/role/r-4f24769c28c611e8a7e3000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "role": {
        "id": "r-4f24769c28c611e8a7e3000c298454d8",
        "name": "超级管理员",
        "description": "所有权限",
        "tag": 0
    }
}
获取角色列表
Request
GET /saltshaker/api/v1.0/role

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "roles": {
        "role": [
            {
                "id": "r-4f24769c28c611e8a7e3000c298454d8",
                "name": "超级管理员",
                "description": "所有权限",
                "tag": 0
            },
            {
                "id": "r-3d13ab3028cb11e8a7e3000c298454d8",
                "name": "产品线管理员",
                "description": "管理产品线",
                "tag": 1
            }
        ]
    }
}
添加角色
Request
POST /saltshaker/api/v1.0/role

POST Body
{
     "name":"产品线管理员",
     "description": "管理产品线"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
删除角色
Request
DELETE /saltshaker/api/v1.0/role/r-555682bc2b1911e886cb000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
修改角色
Request
PUT /saltshaker/api/v1.0/role/r-3814995e28db11e8a7e3000c298454d8

PUT Body
{
     "name":"产品线管理员",
     "description": "管理产品线"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
Clone this wiki locally