7.4.8. 权限
每个资源都包含
权限
子集合。每个
权限都 包含用户
、分配 的角色和
指定资源。例如:
GET /ovirt-engine/api/collection/resource_id/permissions HTTP/1.1 Accept: application/xml HTTP/1.1 200 OK Content-Type: application/xml <permissions> <permission id="permission-id" href="/ovirt-engine/api/collection/resource_id/permissions/permission_id"> <role id="role_id" href="/ovirt-engine/api/roles/role_id"/> <user id="user_id" href="/ovirt-engine/api/users/user_id"/> <resource id="resource_id" href="/ovirt-engine/api/collection/resource_id"/> </permission> ... </permissions>
当 API 用户使用权限表示和
Content-Type: application/xml
标头向 资源的权限
子集合发送 POST
请求时,资源会获取新权限。
每个新权限都需要一个 角色
和用户
:
POST /ovirt-engine/api/collection/resource_id/permissions HTTP/1.1 Content-Type: application/xml Accept: application/xml <permission> <role id="role_id"/> <user id="user_id"/> </permission> HTTP/1.1 201 Created Content-Type: application/xml <permission id="permission_id" href="/ovirt-engine/api/resources/resource_id/permissions/permission_id"> <role id="role_id" href="/ovirt-engine/api/roles/role_id"/> <user id="user_id" href="/ovirt-engine/api/users/user_id"/> <resource id="resource_id" href="/ovirt-engine/api/collection/resource_id"/> </permission>