I wrote a report that I used the checkbox "Promote scoping information to the data source". Here is the resulting query for the report:
DECLARE @v1_TrusteeScope nvarchar(389)
SET @v1_TrusteeScope = N'{171E113B-AEF0-4476-84B5-317C16F0B8A7},{23A16BF2-43EB-48EB-BD24-83C09BC23C9A},{2E1F478A-4986-4223-9D1E-B5920A63AB41},{3D6D7273-72A6-426C-A854-E0C1DF0F2267},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{64623399-DB17-4301-9BDB-8EE3817F7274},{9AD33914-2171-43FF-8335-649C8D276750},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F},{D5647C14-B8A0-4ACD-93A9-8B1352896FC6},{F41AA34A-3C8F-4C12-97A2-B56C5B80DBF4}'
SELECT
[vri2_Computer].[Guid] AS [_ItemGuid],
[vri2_Computer].[Name],
[ajs3_vComputer].[User],
[ajs3_vComputer].[IP Address],
[ajs3_vComputer].[OS Name]
FROM
[vRM_Computer_Item] AS [vri2_Computer]
LEFT OUTER JOIN [vComputer] AS [ajs3_vComputer]
ON ([vri2_Computer].[Guid] = [ajs3_vComputer].[Guid])
WHERE
(
([vri2_Computer].[Guid] IN (SELECT [ResourceGuid] FROM [ScopeMembership] WHERE [ScopeCollectionGuid] IN (SELECT [ScopeCollectionGuid] FROM dbo.fnGetTrusteeScopeCollections(@v1_TrusteeScope))))
)
How do I find what @v1_TrusteeScope should be for the user via some SQL or WF accessible way? If I could figure that part out, I could just pass it as a parm to a direct sql query and I'm golden. I've been digging into the stored procedures and the ASDK but nothing so far.
Thoughts?