Deep Dive into Nintex-determine the role of the current user

Source: Internet
Author: User
Tags xsl xslt

Basic Idea: Use the WebService provided by SharePoint to obtain the role (Web Url/_ vti_bin/usergroup. asmx? WSDL ).

1. Call the method GetGroupCollectionFromUser in usergroup web Service, input the AD account string of the parameter process initiator, and output the XML file.

2. parse the XML file using XSLT to obtain the role set of the Process initiator.

Figure:

Detailed Execution Process

Use Send Notification to view the XML file of the output location

Code

 <xml>
<GetGroupCollectionFromUser xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/">
<Groups>
<Group ID="4" Name="Absence Requests Owners" Description="Use this group to give people full control permissions to the SharePoint site: Absence Requests" OwnerID="4" OwnerIsUser="False" />
</Groups>
</GetGroupCollectionFromUser>
</xml>

 

The detailed XSLT code is as follows:

Code

 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://schemas.microsoft.com/sharepoint/soap/directory/">
<xsl:template match="/">
<xsl:for-each select="xml/h:GetGroupCollectionFromUser/h:Groups/h:Group">
<xsl:value-of select="@Name"/>;</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Parse the role set and use ";" to separate each array element and output the following string:

Absence Requests Owners;

If the initiator user belongs to multiple users, it is shown as follows: Absence Requests Owners; HR; Payroll;

Process File download: download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.