Skip to content

aSitePermissions statement

The aSitePermissions statement returns the collection of permissions for one or multiple sites.

<aSitePermissions tableName="">
<from type=""></from>
<fields></fields>
<where></where>
</aSitePermissions>

Specify one or more web sites from which to retrieve the collection of permissions. The type attribute will indicate how site urls are specified.

Type Description
Url Specify one or more relative site url separated by a comma. A report’s parameter may be specified instead of a literal value.
ResultSet Specify the tableName value of another statement. The resulting data from the statement must contain a column named “relativeSiteUrl”.

The following statement will return all the collection of permissions for the sites “/sites/ersdedemo/” and “/sites/ersdetest”.

Sample

<aSitePermissions tableName="SitePermissions">
<from type="Url">/sites/ersdedemo/,/sites/ersdetest/</from>
<fields>*</fields>
<where></where>
</aSitePermissions>

In the following example, the query will return the permissions for all the sites specified in another result set called “MergingList”. The “MergingList” result set contains data returned by a list statement that queries the “Merging List” SharePoint list.

The SharePoint list “Merging list” must contain a column called “RelativeSiteUrl” that contains relative urls that point to SharePoint sites.

The aSitePermissions statement will retrieve the permissions for each item in the “MergingList” result set based on the “RelativeSiteUrl” column’s value.

Sample

<root xmlns="http://enesyssoftware.com/schemas">
<list title="Merging list" relativeSiteUrl="/sites/demo/" tableName="Merginglist">
<fields>relativeSiteUrl</fields>
<query></query>
</list>
<aSitePermissions tableName="aSitePermissions">
<from type="ResultSet">Merginglist</from>
<fields></fields>
<where></where>
</aSitePermissions>
<resultSet>aSitePermissions</resultSet>
</root>

Specify the fields to be returned by the statement.

Field Description
MemberID The ID of the User or the group.
Mask A mask of permission flags.
MaskAsString The string representing the mask of permission flags. Values are semi-colon separated.
MemberIsUser Boolean that specifies whether the member is a user.
MemberGlobal Boolean that specifies whether the member is a group.
Name The login name of the user if MemberIsUser is TRUE; otherwise the group name.

SQL Where clause used to filter the resulting data.

The following query returns information about permissions for the “/sites/ersdetest” site that are given to users:

Sample

<aSitePermissions tableName="aSitePermissions1">
<from type="Url">/sites/ersdetest/</from>
<fields></fields>
<where>MemberIsUser</where>
</aSitePermissions>