简体   繁体   English

重定向到主页是用户不是站点权限所有者组的成员

[英]Redirect to homepage is user is not a member of the site permissions Owner group

How can I write the following in JavaScript?如何在 JavaScript 中编写以下内容? in SharePoint 2019, if a user who is not a member of the site permissions Owner group is immediately redirected to the homepage... Thanks in advance!在 SharePoint 2019 中,如果不是站点权限所有者组成员的用户立即重定向到主页...提前致谢!

There is JavaScript library that provided a easy way to check user's group membership: JavaScript 库提供了一种简单的方法来检查用户的组成员身份:

 $(document).ready(function() {  $().SPServices({   operation: "GetGroupCollectionFromUser",   userLoginName: $().SPServices.SPGetCurrentUser(),   async: false,   completefunc: function(xData, Status) {   var xml = xData.responseXML.xml;      //If the current User does belong to the group "Service desk Operators"     if (xml.search('Service Desk Operators');= -1)      {           //   do your logic                }       }  }); });

Other references or demos:其他参考或演示:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM