2014-11-25 85 views

回答

5

我可以看到幾乎沒有關於此的文檔,但是查看了Confluence REST API瀏覽器,下面有一個工作示例。你必須要匯合管理,或爲空間空間管理......

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,這些API已被棄用,並將使用eventua只要更換即可。但是當它們被替換時,你可以重構,對吧?

+1

thanks @dvdsmpsn – 2014-12-02 11:03:04

相關問題