Permission to execute an extension service operation is controlled by an AclRule contained in the ResourceClassAction.
An ACL rule specifies the access controls that apply to a ResourceClassAction. Access controls can be defined for any of the following principals:
■
| |
■
| |
■
| |
■
|
any resource defined by the service that created the ACL rule |
Rights for specific entity types are specified in the following container elements:
If the Access element in any of these containers has the value Entity, the container must also include an Entity element that provides a reference to a resource entity, organization, user, or right.
A ResourceClassAction can include an arbitrary number of AclRule elements. The action is permitted if the user or resource attempting the action matches any rule.
1 | Retrieve the XML representation of the resource class action. This request retrieves the XML representation of the resource class action created in Example: Define an Action for a Resource Class: GET https://vcloud.example.com/api/admin/extension/service/resourceclassaction/268 |
2 | Examine the response to find the Link for specifying ACL rules for the resource class action. This Link has the following form: <vcloud:Link rel="add" type="application/vnd.vmware.vcloud.query.aclRule+xml" href="https://vcloud.example.com/api/admin/extension/service/resourceclassaction/268/aclrules" /> |
3 |
See the request portion of Example: Define an ACL Rule for a Resource Class Action for information about the contents of this element. |
4 | POST the AclRule element to the URL described in Step 2. |
This example adds an ACL rule to the resource class action created in Example: Define an Action for a Resource Class. The rule specifies that all members of a specific organization who have a role that includes a specific right can execute the action.
POST https://vcloud.example.com/api/admin/extension/service/resourceclassaction/268/aclrules Content-type: application/vnd.vmware.admin.aclRule+xml <?xml version="1.0" encoding="UTF-8"?> <vmext:AclRule xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="ACL rule for read backups"> <Description>Only users in org/26 who have right/2 can read backups</Description> <vmext:ServiceResourceAccess> <vmext:Access>Shared</vmext:Access> </vmext:ServiceResourceAccess> <vmext:OrganizationAccess> <vmext:Access>Entity</vmext:Access> <vmext:Entity xsi:type="vcloud:ResourceReferenceType" type="application/vnd.vmware.admin.org+xml" href="https://vcloud.example.com/api/admin/org/26" /> </vmext:OrganizationAccess> <vmext:PrincipalAccess> <vmext:Access>Entity</vmext:Access> <vmext:Entity xsi:type="vcloud:ResourceReferenceType" type="application/vnd.vmware.admin.right+xml" href="https://vcloud.example.com/api/admin/right/2" /> </vmext:PrincipalAccess> </vmext:AclRule>
The response contains information supplied in the request, along with several Link elements created by the server.
201 Created Content-Type: application/vnd.vmware.admin.aclrule+xml ... <vmext:AclRule xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" name="ACL rule for read backups" id="urn:vcloud:aclRule:5" type="application/vnd.vmware.admin.aclRule+xml" href="https://vcloud.example.com/api/admin/extension/service/aclrule/5"> <Description>Only users in org/26 who have right/2 can read backups</Description><vcloud:Link <vcloud:Link rel="remove" href="https://vcloud.example.com/api/admin/extension/service/resourceclassaction/268" /> ... </vmext:AclRule>