开发者

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

开发者 https://www.devze.com 2023-02-10 23:40 出处:网络
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 ru

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

精彩评论

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