uni-id-roles.schema.json 1.2 KB
Newer Older
1 2
{
	"bsonType": "object",
3
	"required": ["role_id", "role_name"],
4
	"permission": {
5 6 7 8
		"read": "'READ_UNI_ID_ROLES' in auth.permission",
		"create": "'CREATE_UNI_ID_ROLES' in auth.permission",
		"update": "'UPDATE_UNI_ID_ROLES' in auth.permission",
		"delete": "'DELETE_UNI_ID_ROLES' in auth.permission"
9 10 11 12 13 14
	},
	"properties": {
		"_id": {
			"description": "存储文档 ID,系统自动生成"
		},
		"comment": {
15
			"title": "备注",
16 17 18 19 20 21 22 23 24 25 26 27
			"bsonType": "string",
			"description": "备注",
			"trim": "both"
		},
		"create_date": {
			"bsonType": "timestamp",
			"description": "创建时间",
			"forceDefaultValue": {
				"$env": "now"
			}
		},
		"permission": {
28
			"title": "权限",
29 30
			"bsonType": "array",
			"foreignKey": "uni-id-permissions.permission_id",
31 32 33 34 35
			"description": "角色拥有的权限列表",
			"enum": {
				"collection": "uni-id-permissions",
				"field": "permission_name as text, permission_id as value"
			}
36 37
		},
		"role_id": {
38
			"title": "唯一ID",
39 40 41 42 43
			"bsonType": "string",
			"description": "角色唯一标识,不可修改,不允许重复",
			"trim": "both"
		},
		"role_name": {
44
			"title": "名称",
45 46 47 48
			"bsonType": "string",
			"description": "角色名称",
			"trim": "both"
		}
49 50
	}
}