开发者

WebPart that redirect if user is not in a specific SharePoint security group

Does anybody know of a webpart, webpart code or client code that will do this?

I'd like to give a security group contribute to a sepecific list, but want to customize copies of the forms they can run and would like to make sure th开发者_StackOverflowey can't run other speicfic forms for the list.

When the webpart sees they are not in a specific security group it will redirect them to an error page or some other page.


You can create a webpart that runs this code:

if (!SPContext.Current.Web.SiteGroups["groupname"].ContainsCurrentUser)
{
  SPUtility.Redirect("url", SPRedirectFlags.Default, HttpContext.Current);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜