Here is a useful (if rather verbose) script that will show users and their permissions from the root folder on SQL Server Reporting Services downwards. It should work on most if not all versions of the product. You can use it as is, or as a starting point to create your own aggregations etc.
<end>
USE ReportServer;
SELECT
CASE
WHEN (SubString(c.[Path], 1, Len(c.[Path]) - (CharIndex('/', Reverse(c.[Path])) - 1))) = ''
THEN '<root folder>'
ELSE SubString(c.[Path], 1, Len(c.[Path]) - (CharIndex('/', Reverse(c.[Path])) - 1))
END AS Folder
,CASE
WHEN c.Type = 1
THEN 'Path'
WHEN c.Type = 2
THEN 'Report'
WHEN c.Type = 3
THEN 'Resource'
WHEN c.Type = 4
THEN 'Linked Report'
WHEN c.Type = 5
THEN 'Data Source'
WHEN c.Type = 6
THEN 'Report Model'
WHEN c.Type = 7
THEN 'Report Part'
WHEN c.Type = 8
THEN 'Shared Dataset'
END AS 'ObjectType'
,CASE
WHEN c.NAME = ''
THEN '<root folder>'
ELSE c.NAME
END AS ObjectName
,u.UserName
,r.RoleName AS [Permissions]
FROM [users] u
INNER JOIN PolicyUserRole pu
ON u.userid = pu.userid
INNER JOIN roles r
ON pu.roleid = r.roleid
INNER JOIN CATALOG c
ON pu.PolicyID = c.PolicyID
ORDER BY c.NAME
,u.UserName
<end>
Comments
Post a Comment