Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

A question from stackoverflow

Case:

  • Create a User Policy in SharePoint 2010 Web Application Management: assign 'Full read' to user XXX for site YYY;

  • Call SiteData.asmx/GetContent for site YYY and inspect 'permissions' node.

User XXX is not assigned any permissions for site YYY according to WS call result.

How should I retrieve permissions of XXX for YYY via web services? In which table assigned User Policy is stored in SharePoint Content database?

share|improve this question
add comment

1 Answer

You need to use the usergroup.asmx web service and call "GetGroupCollectionFromUser"

If the returned xml has the correct group in it:

Group[Name='<groupName>']

Then they have permission.

If you need there are also functions in usergroup.asmx to get things like role info etc.

MSDN usergroup.asmx

share|improve this answer
    
If I do so (assign a policy to the user that has never logged into the site before; login with this user to the SP site), then GetGroupCollectionFromUser returns empty result for me: ` <GetGroupCollectionFromUser xmlns="schemas.microsoft.com/sharepoint/soap/directory/">; <Groups /> </GetGroupCollectionFromUser>` –  pavel.baravik Nov 27 '12 at 12:19
    
So you're not defining groups for roles and assigning groups? You would have to get the roles back for the user then. Then you would have to do something a little more complex with GetRolesAndPermissionsForCurrentUser. Where there is a will there is a way. –  Hugh Wood Nov 27 '12 at 13:24
    
Could you please clarify the purpose of this method (GetRolesAndPermissionsForCurrentUser)? it returns me something even if I call it with invalid credentials, so who is 'current user' then? –  pavel.baravik Nov 28 '12 at 10:33
    
It should be returning you permissions of basically you have none if the credentials are invalid. –  Hugh Wood Nov 28 '12 at 12:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.