# 批量创建授权策略 (后端接口)

# 调用方式: POST

# 接口地址:

https://api.freelog.com/v2/policies
1

# body传入参数说明:

参数 必选 类型及范围 说明
policyTexts 必选 string[] 策略文本,encodeURIComponent编码
subjectType 必选 int 标的物类型 1:资源 2:展品 3:用户组

# body示例

{
    "policyTexts":["for%20public%3A%20%20%20initial1%3A%20%20%20%20active%20%20presentable%20%20%20terminate%20%20", "for%20public%3A%20%20%20initial%3A%20%20%20%20active%20%20presentable%20%20%20terminate%20"],
    "subjectType":1
}


1
2
3
4
5
6

# 返回说明(按照策略文本顺序决定结果顺序):

返回值字段 字段类型 字段说明
policyId string 策略ID
userId int 用户ID
policyName string 策略名称
policyText string 策略文本
createDate date 创建日期

# 返回示例

{
    "ret": 0,
    "errcode": 0,
    "msg": "success",
    "data": [
        {
            "policyId": "15b30e2fba98bea17f1398d0521321e9",
            "policyText": "for public:   initial1:    active  presentable   terminate  ",
            "subjectType": 1,
            "fsmDescriptionInfo": {
                "initial1": {
                    "authorization": [
                        "active",
                        "presentable"
                    ],
                    "transition": {
                        "terminate": null
                    }
                }
            }
        },
        {
            "policyId": "6f1b98c7b6f822e862b56a01eb1c9de4",
            "policyText": "for public:   initial:    active  presentable   terminate ",
            "subjectType": 1,
            "fsmDescriptionInfo": {
                "initial": {
                    "authorization": [
                        "active",
                        "presentable"
                    ],
                    "transition": {
                        "terminate": null
                    }
                }
            }
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39