Subsite.getAncestors (Method)

Returns one or more structures, each containing subsite information and all of its ancestor subsites. If a subsite general security permission is passed, CommonSpot returns the value of that permission. These structures are returned in ascending order starting with the root subsite.

Returns:

Subsite_GetAncestors_Result (query)

Each row of the returned query results has the following fields:

Field Name Type Description
Description PlainText The subsite's description.
DisplayName PlainText The subsite's display name.
hasPermission Boolean Boolean flag which when true indicates that the specified permission is enabled. If no 'PermissionToCheck' argument was passed, CommonSpot sets this value to 0.
Name PlainText The subsite's name.
SubsiteID SubsiteID This subsite's ID.
SubsiteURL SubsiteURL The server-relative URL of the page's subsite.

Arguments:

Name Type Required Description
subsiteIDOrURL SubsiteIDorURL_EmptyString Required The ID of the target subsite, or the server relative path to the target subsite, an empty string for the current subsite.
permissionToCheck SubsiteGeneralPermission_EmptyString Optional. Defaults to an empty string. A general permission for this subsite; for example, 'CreateKeywords', 'SaveAsElements', 'UploadImage', and so on. If an empty string is passed, the returned information has its 'hasPermission' state set to 0.

Context:

License Requirements None
Permission Requirements ContributorOrServerCode
Deny Context None
Require Context None
Author Lock (not required)
Transaction Logging Transaction logging is disabled for this method
Customization This method may be customized at the site level

Error Codes:

None

Notes:

None