Skip to content

RESTful API For Role

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

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

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

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

{
    "data": [
        {
            "id": "r-9e3be2ca318f11e8ab56000c298454d8",
            "tag": 0,
            "name": "超级管理员",
            "description": "所有权限"
        },
        {
            "id": "r-35d85a1a333311e8aa5f000c298454d8",
            "tag": 1,
            "name": "普通用户",
            "description": "默认普通用户"
        },
        {
            "id": "r-35d85a1b333311e8aa5f000c298454d8",
            "tag": 2,
            "name": "产品管理员",
            "description": "管理产品权限"
        },
        {
            "id": "r-35d85a1c333311e8aa5f000c298454d8",
            "tag": 3,
            "name": "用户管理员",
            "description": "管理用户权限"
        },
        {
            "id": "r-35d85a1d333311e8aa5f000c298454d8",
            "tag": 4,
            "name": "访问控制管理员",
            "description": "管理访问控制列权限"
        }
    ],
    "status": true,
    "message": ""
}
添加角色
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": ""
}