SPWeb.Groups 与 SPWeb.AssociatedGroups

发布于 2024-10-12 15:14:44 字数 375 浏览 3 评论 0原文

我见过 SPWeb 对象的三种类型的组属性 - GroupsSiteGroupsAssociatedGroups

据我所知,SiteGroups 将获取当前网站集中的所有组。但是GroupsAssociatedGroups 之间有什么区别。 MSDN 定义表示Groups 将获取该网站的所有“跨站点”(!) 组。 AssociatedGroups 从名字上就很容易理解。

那么 Groups 返回什么?有人可以用一个例子来解释我吗?

I've seen three types of group properties for an SPWeb object - Groups, SiteGroups, AssociatedGroups.

I understand that SiteGroups will fetch all the groups in the current site collection. But what is the difference between Groups and AssociatedGroups. MSDN definition says that Groups will get all the 'cross-site'(!) groups for that web site. AssociatedGroups are fairly easily to understand just from the very name.

So what does Groups return? Can somebody explain me with an example?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

偏闹i 2024-10-19 15:14:44

Groups 返回已分配给当前站点的安全角色的所有组。

AssociatedGroups 返回人员和组页面左侧菜单中可见的所有组。这些组可能无权访问当前站点(如果安全设置不是从父站点继承的)。在这种情况下,其中一些不会在 Groups 属性中列出。

要查看差异,请在子网站中创建一个新组而不授予任何权限。该组将在AssociatedGroups 和左侧菜单中可见,但不会在Groups 或网站权限页面中列出。

Groups return all groups which have security roles assigned to the current site.

AssociatedGroups return all groups visible in the left menu of the People and Group page. Those groups may not have access to the current site (if the security settings do not inherit from parent site). In this case, some of them will not be listed in the Groups property.

To view the difference, in a subsite, create a new group without giving any permission. The group will be visible in the AssociatedGroups and Left menu, but will not be listed in Groups or Site Permissions page.

忱杏 2024-10-19 15:14:44

我相信msdn有答案

http://msdn.microsoft .com/en-us/library/microsoft.sharepoint.spweb.sitegroups.aspx

获取包含网站集中所有组的集合。

http://msdn.microsoft.com/en-us /library/microsoft.sharepoint.spweb.groups.aspx

获取包含网站所有组的集合。以下代码示例使用 Groups 属性返回当前网站集中指定网站的组集合。

这意味着,SPGroup 已在 SPWeb 的某处使用(即分配了权限)。

I believe msdn has the answer

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.sitegroups.aspx

Gets a collection that contains all the groups in the site collection.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.groups.aspx

Gets a collection that contains all the groups for the website. The following code example uses the Groups property to return the collection of groups for a specified site in the current site collection.

Which means, the SPGroup has been used in (ie assigned a permission in) the SPWeb somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文