Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Querying Permissions

  Asked By: Zachariah    Date: Jul 07    Category: Sharepoint    Views: 2983

I know we can retrieve permissions for sites / areas via the Object
Model, but has anyone been able to do queries against the database
to generate reports showing permissions for specific sites?

We have a set of sites (we can identify by the WebTemplate used) and
would like to generate a quick report detailing out who has what
permission for each.

Has anyone done any queries similar to this?



2 Answers Found

Answer #1    Answered By: Graham Ingram     Answered On: Jul 07

This is possible. However querying  using membership using the Object
Model requires Sharepoint Administrative privilege (user will get
challenged if they don't have access to querying membership.

Answer #2    Answered By: Donte Jefferson     Answered On: Jul 07

If anyone is interested, this query returns the groups and users in
a group who have permission to a specified site...

SELECT DISTINCT dbo.Webs.FullUrl AS URL, dbo.WebGroups.Title AS
[Group], dbo.UserInfo.tp_Title AS [User Name]
dbo.WebGroups INNER JOIN
dbo.WebGroupMembership ON dbo.WebGroups.WebID
= dbo.WebGroupMembership.WebID AND
dbo.WebGroups.ID =
dbo.WebGroupMembership.GroupID INNER JOIN
dbo.UserInfo ON
dbo.WebGroupMembership.MemberID = dbo.UserInfo.tp_ID ON
dbo.Webs.SiteId = dbo.UserInfo.tp_SiteID AND
dbo.Webs.Id = dbo.WebGroups.WebID
WHERE (dbo.Webs.FullUrl LIKE N'%nameofsite%')
ORDER BY dbo.Webs.FullUrl, dbo.WebGroups.Title

Didn't find what you were looking for? Find more on Querying Permissions Or get search suggestion and latest updates.