Sites for a user that have permission to?

Oct 7, 2010 at 9:13 PM

I can't find a logic on how to get sites that user have permission to. Any thought?

Coordinator
Oct 8, 2010 at 1:40 AM

Have you looked at the Users and Groups Web Services, specifically things like GetRolesAndPermissionsForCurrentUser?

M.

Oct 11, 2010 at 6:49 PM

Yes. I have looked into that but still how do I know if the user belong to a certain site?

I can find their group, their role, but I dont see anything about user's site.
Do you think my logic is correct if I do

1. get the group from user
2. get the site that have these group and then display the site url if the group name the same with no 1.

For me still not right because there is no connection between the user and the sites.

 

Coordinator
Oct 13, 2010 at 3:11 AM
Edited Oct 13, 2010 at 3:24 AM

Are you trying to do this for a single user? If you used GetAllSubWebCollection and then GetRolesAndPermissionsForCurrentUser for each in a .each(), you'd see where the user has permissions. Or is that not what you mean?

M.

p.s. I realized after I posted the suggestion above that it won't do the trick. Can you explain a bit more what you're trying to do?

Oct 13, 2010 at 9:33 PM
Edited Oct 13, 2010 at 10:29 PM

In C# I know sitedata.GetWeb Method basically I can get infomation about the users and groups for the current sharepoint site. It is not ideal but the concept there.

I'm trying to get information for each user if they have access to sharepoint site then display the URL. I can do it with c#, but I have limitation here and need to do it with client script.

Maybe you should add your library to include sitedata.GetWeb?

 

<Users>
  <User ID="1" Sid="S-1-5-21-
     2127521184-1604012920-
     1887927527-76687" 
     Name="Display_Name" 
     LoginName="DOMAIN\User_Alias" 
     Email="Email_Address" Notes=""
     IsSiteAdmin="True" 
     IsDomainGroup="False" />
  <User ID="1" Sid="S-1-5-21-
     2127521184-1604012920-
     1887927527-259353" 
     Name="Display_Name" 
     LoginName="DOMAIN\User_Alias" 
     Email="Email_Address" Notes=""
     IsSiteAdmin="True" 
     IsDomainGroup="False" />
</Users>

 

thanks

A

Oct 14, 2010 at 10:11 AM

Why do you have to use client script?

If you can write the c# code, but not on that particular page, why not use AJAX to return the c# results to your page?

Oct 14, 2010 at 11:36 PM

Like I said can't use C# for this client dont have access to the server

Coordinator
Oct 15, 2010 at 2:37 AM

What about GetUserCollectionFromSite? It seems to pass back similar user information to SiteDate.GetWeb.

The reason I haven't wrapped the SiteData operations is that there are analogous operations sprinkled across the other Web Services.

M.

Oct 15, 2010 at 4:07 PM

Actually I got it to work using Multidimensional arrays.