Workflow and ServiceDesk Community

 View Only
  • 1.  How to get all trustee ids for current user

    Posted Apr 23, 2014 11:38 AM

    Whenever a user runs a report in the NS, the server adds the users trustee ids as parameters into the report, so that only the resources to which the user has access are being returned.

    I would like to achieve similar functionality with a workflow, but I don't understand how to generate the list of all trustee ids the user belongs to (based on security groups and nested groups).

    Any hints on how to get those are appreciated as then I could pre filter the data on SQL level, before displaying any resources to the user in the workflow.



  • 2.  RE: How to get all trustee ids for current user

    Posted Apr 23, 2014 02:15 PM

    A report always starts its sql query off with this line, followed by its SELECT statement:- 

     

    DECLARE @v1_TrusteeScope nvarchar(max)

    SET @v1_TrusteeScope = N'%TrusteeScope%'

     

    The SELECT statement will include the following lines which JOIN the trustee syntax to a database object, which in this example was the vComputer view which was given an alias of "i" :-

     

    JOIN dbo.ScopeMembership sm ON sm.[ResourceGuid] = i.Guid

    AND sm.[ScopeCollectionGuid] IN

    (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))