Application Programming Interface Guide > Web Services Operations > Operations Reference > copyResourcePrivileges
 
copyResourcePrivileges
Enable changes to resource privileges for users and groups, by copying privileges from other resources.
Changes can be made to one or more resources with different source resources for one or many users and groups. Resource privileges can be set for a specified set of users and groups without modifying any existing privileges for other users and groups, or the procedure can set resource privileges restrictively to only privileges on the explicit source resources.
Only a user with GRANT privilege on a resource can modify the privileges for that resource. The owner of a resource always has GRANT privilege, as do users with the MODIFY_ALL_RESOURCES right.
When mode is OVERWRITE_APPEND or is not supplied, privileges are applied user by user, so that updating privileges for one user or group does not alter privileges from any other user or group.
The privileges applied for a user or group replace the previous value for that user or group.
When mode is SET_EXACTLY, all privileges on the resource are made to look exactly like the privileges of source resource.
When updateRecursively is FALSE, privileges are applied only to the specified resources. When it is TRUE, privileges are recursively applied into any CONTAINER or DATA_SOURCE resource specified. When recursively applying privileges, the privilege change is ignored for any resource the user lacks owner privileges for. Privileges that are not applicable for a given resource type are automatically stripped down to the set that is legal for each resource:
TABLE resources support NONE, READ, WRITE, SELECT, INSERT, UPDATE, and DELETE.
PROCEDURE resources support NONE, READ, WRITE, and EXECUTE.
All other resource types only support NONE, READ, and WRITE.
Location
/services/webservices/system/admin/resource/operations/
Request Elements
updateRecursively: If TRUE, all children of the given resources are recursively updated with the privileges assigned to their parent.
copyPrivilegeEntries: List of entries containing one source resource and a list of destination resources. Privileges of the source resource are copied over to destination resources in the specified mode.
copyPrivilegeEntry (optional):
srcResource: Path and type of source resource.
dstResource (one or more): Path and type of destination resource.
mode (optional): Determines whether privileges are merged with existing ones:
OVERWRITE_APPEND (default) merges and does not update privileges for users or groups not mentioned.
SET_EXACTLY makes privileges look exactly like those provided in the call.
Response Elements
N/A
Faults
IllegalArgument: If any path is malformed, or any type or privilege entry is illegal, or mode is not one of the legal values.
NotAllowed: If an attempt is made to use this operation with an insufficient license.
NotFound: If a path refers to a resource that does not exist.
Security: If for a given entry path the user does not have READ access on any item in a path other than the last item, or does not have GRANT access on the last item.
Security: If the user does not have the ACCESS_TOOLS right.