2012-05-30 98 views
0

我試圖在SP 2010中獲得一個用戶組。我目前有五個組,但SPGroupCollection僅包含兩個,當我閱讀oSPWeb.Groups的組時。任何人都知道這是否有任何安全或其他原因?SPGroupCollection包含缺失的組

代碼:

using (SPSite oSPsite = new SPSite(_serverUrl)) 
      { 

       using (SPWeb oSPWeb = oSPsite.OpenWeb()) 
       { 

           SPGroup spGroup = oSPWeb.Groups["AIT Owners"]; 

        } 

      } 

回答

0

是的,有一個安全的理由。 Groups屬性將僅返回在網站內已分配權限的組,而SiteGroups屬性將返回網站集內的所有組。

欲瞭解更多信息,還有一個number of blog articles覆蓋差異。