我正在使用Atlassian Confluence REST API。我需要获得空间权限。我在文档中找不到任何信息。
有谁知道如何获得这些权限?
最佳答案
我几乎看不到任何文档,但是查看了Confluence REST API浏览器后,下面有一个有效的示例。您必须是Confluence管理员或空间管理员。
POST: http://localhost:1990/confluence/rpc/json-rpc/confluenceservice-v2/getSpacePermissionSets
BODY: [ "ds" ]
响应:
[
{
"type": "SETSPACEPERMISSIONS",
"spacePermissions": [
{
"type": "SETSPACEPERMISSIONS",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EXPORTSPACE",
"spacePermissions": [
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": null
},
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EXPORTSPACE",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "SETPAGEPERMISSIONS",
"spacePermissions": [
{
"type": "SETPAGEPERMISSIONS",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "SETPAGEPERMISSIONS",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "REMOVEMAIL",
"spacePermissions": [
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEMAIL",
"userName": null,
"groupName": null
}
]
},
{
"type": "REMOVEBLOG",
"spacePermissions": [
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": null
},
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVEBLOG",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EXPORTPAGE",
"spacePermissions": [
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": null
},
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "EXPORTPAGE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "REMOVEATTACHMENT",
"spacePermissions": [
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": null
},
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEATTACHMENT",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "CREATEATTACHMENT",
"spacePermissions": [
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": null
},
{
"type": "CREATEATTACHMENT",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "VIEWSPACE",
"spacePermissions": [
{
"type": "VIEWSPACE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "VIEWSPACE",
"userName": null,
"groupName": null
},
{
"type": "VIEWSPACE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "EDITBLOG",
"spacePermissions": [
{
"type": "EDITBLOG",
"userName": null,
"groupName": null
},
{
"type": "EDITBLOG",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EDITBLOG",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "REMOVEPAGE",
"spacePermissions": [
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": null
},
{
"type": "REMOVEPAGE",
"userName": null,
"groupName": "confluence-users"
}
]
},
{
"type": "REMOVECOMMENT",
"spacePermissions": [
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": null
},
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "REMOVECOMMENT",
"userName": null,
"groupName": "confluence-administrators"
}
]
},
{
"type": "EDITSPACE",
"spacePermissions": [
{
"type": "EDITSPACE",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "EDITSPACE",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "EDITSPACE",
"userName": null,
"groupName": null
}
]
},
{
"type": "COMMENT",
"spacePermissions": [
{
"type": "COMMENT",
"userName": null,
"groupName": "confluence-users"
},
{
"type": "COMMENT",
"userName": null,
"groupName": "confluence-administrators"
},
{
"type": "COMMENT",
"userName": null,
"groupName": null
}
]
}
]
它使用的旧JSON-RPC REST API已被弃用,最终将被替换。但是当它们被替换时,您可以重构,对吗?