Application Programming Interface Guide > Web Services Operations > Operations Reference > changeResourceOwner
 
changeResourceOwner
Change the owner of a resource to the user specified by the newOwnerName input attribute. The new resource owner gets only the GRANT privilege, but this allows management of the resource and delegation of resource privileges as appropriate.
This operation can only be called by users with the MODIFY_ALL_RESOURCES right.
You cannot change ownership of resources already owned by system. The reverse is also true: resources cannot change ownership to become a system-owned resource. Additionally, resources cannot be owned by any user in the dynamic domain, or by the anonymous user in the composite domain. Attempts to change resources this way are quietly ignored.
If the recurse element is TRUE (set to 1) and the resource is a container, the ownership change affects all resources within the container, including the container itself.
Changing the ownership of a physical data source implicitly affects all contained resources.
Resources within physical data sources cannot have their ownership directly changed. If recurse is TRUE, the physical data source is changed, but this operation does not recurse into the data structure, because the ownership change of the child resources is implicitly changed to match the data source.
The currentOwnerName attribute restricts change of resource ownership to only those resources that are owned by the currently named owner. When the currentOwnerName feature is used with the recurse feature, the combined effect changes ownership of only those child resources owned by currentOwnerName.
The default value for newOwnerDomain and currentOwnerDomain is composite unless otherwise specified. They are optional input attributes.
Location
/services/webservices/system/admin/resource/operations/
Request Elements
path: The path of the resource to assign to a new owner.
type: The type of the resource specified by the given path. Valid values are CONTAINER, DATA_SOURCE, DEFINITION_SET, LINK, PROCEDURE, TABLE, TREE, and TRIGGER.
detail: The level of detail about the resources to include in the response. Valid values are NONE, SIMPLE, and FULL.
newOwnerName: The name of the new owner.
newOwnerDomain (optional): The domain name of the new owner. Defaults to composite if not set.
currentOwnerName (optional): The name of the current owner. When user name is set, this restricts ownership changes to those resources currently owned by the specified user.
currentOwnerDomain (optional): The domain name of the current owner. Defaults to composite if not set, and to currentOwnerName if set.
recurse (optional): If set to TRUE (1), the ownership change applies recursively to child resources within the resource container. Default value is 0, meaning no recursion is attempted.
Response Elements
resources: List of the modified resources and resource definitions. See Resources Element.
Faults
IllegalArgument: Either the path element was malformed or an illegal type or detail was provided.
NotAllowed: If the resource is a child of a physical data source.
NotAllowed: If the resource is currently owned by system.
NotAllowed: If newOwnerName is system in the composite domain.
NotAllowed: If newOwnerName is anonymous in the composite domain.
NotAllowed: If newOwnerDomain is dynamic.
NotAllowed: If currentOwnerName is system in the composite domain.
NotAllowed: If an attempt is made to use this operation with an insufficient license.
NotFound: If the resource or any portion of the path to the resource does not exist.
NotFound: If the newOwnerName or currentOwnerName does not exist.
NotFound: If the newOwnerDomain or currentOwnerDomain does not exist.
Security: If the user does not have READ access on all items in the path to the resource.
Security: If the user does not have WRITE access to the last item in path.
Security: If the user does not have ACCESS_TOOLS and MODIFY_ALL_RESOURCES rights.
Note: Separate actions may be needed to make a resource accessible and visible to the new owner. The changeResourceOwner operation does not move resources into accessible directories. Use moveResource or moveResources to place the resource in a directory for which the new owner has read privileges on all parent containers.