My requirement is when someone login to site and if he belong to 'owner' group it need to redirect immediately to specific site and if he belong to member group then need to navigate/redirect to same specified site other page.
-
This requirement seems very easy to fulfill. Which problem are you facing exactly? What did you tried? – Steve B Feb 06 '15 at 09:31
-
user login the local system means windows login and enter the sharepoint url open the he related page means not home page other page means page 1 i created new page in site name: page1 and admin will login that system home page will open. how to do please explain this is sharepoint site 2010 functionality – Prasanth Nellore Feb 06 '15 at 10:30
-
this is the task Steve please explain we need urzent – Prasanth Nellore Feb 06 '15 at 10:31
-
You did not answer to my question. And please, do not tells it is urgent. Good questions will have chances to get quickly good answer. Your question is not properly written. – Steve B Feb 06 '15 at 10:32
-
i worte javascript, based on the login user home page will open not open page1 – Prasanth Nellore Feb 06 '15 at 10:36
-
i want starting to end flow – Prasanth Nellore Feb 06 '15 at 10:42
2 Answers
A very simple solution could be to use SPSecurityTrimmedControl
. What it does is that it adds whatever is inside the control only if the specified access is fulfilled by the user.
So what you can do is that set the permissioning of the control to full control and include a simple redirect JavaScript. And just after that, outside the control, add a redirect script to other control. Something like below:
<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" runat="server" AuthenticationRestrictions="AuthenticatedUsersOnly" Permissions="ManageWeb" PermissionContext="CurrentSite">
<script type='text/javascript'>javascript to redirect owners</script>
</SharePoint:SPSecurityTrimmedControl>
<script type='text/javascript'>javascript to redirect readers</script>
So if the user is an owner, the owner redirect sscript will be present on the page and if not then it will redirect to the reader's page.

- 9,037
- 7
- 45
- 73
-
-
just search google "Javascript to redirect" would give you tons of solutions. @PrasanthNellore – Saksham Feb 09 '15 at 12:18
Since it is in SP2010, I assume we use server side C# code instead of CSOM, which is not matured yet in SP2010.
create a static helper method like:
public static bool IsInGroup(this SPUser user, SPGroup group) { return user.Groups.Cast() .Any(g => g.ID == group.ID); } }
verify in your code if the user belongs to certain group
SPUser user; SPGroup group; bool belongToGroup = user.InGroup(group);
use SPUtility.Redirect to redirect the user to any page you need.
Hope this helps somehow.

- 28
- 5