I want to redirect users from a landing page to another page in SharePoint 2010, based on their group membership. I need to do this using JavaScript (ECMAScript) and not server side code.
|
You can get the group collection of a site and enumerate over it to find a specific group. You can then enumerate the members of the group to find the current user.
|
|||
|
|
|
You could wrap your redirect inside a SPSecurityTrimmedControl
Here are the values you can use for PermissionString. If you want to find users that do NOT have a certain permission, this code would work better:
|
|||
|
|
You can use a content editor web part for your script then use audience targeting on the webpart to determine what groups should see it. |
|||
|
|
|
You can actually do this using a generic HttpHandler and call from the client browser. Will share you some code sample later. |
|||
|
|
|
|
|||||
|
|
You can get the groups in client side Silverlight app by calling the GetGroupCollectionFromUserAsync method of SharePoint's UserGroup.asmx web service. check out the link below for sample code. http://www.innovawiz.com/get-the-sharepoint-groups-a-user-is-part-of-using-sharepoint-object-model |
|||||
|
