2012-10-19 130 views
0
  • 的SharePoint 2010
  • 基於表單的身份驗證(FBA)
  • SqlMembershipProvider的

有沒有一種方法來檢索FBA '的用戶,在角色' 通過SP數據Web服務基礎設施?讓用戶會員在SharePoint 2010中FBA

它在檢索SharePoint組,權限和角色時很好地發揮作用,但是如何讓FBA用戶成爲FBA角色的成員?

'GetRoleCollectionFromUser'方法顯示'user not found'爲基於聲明的id,如'i:0#.f | fbamembershipprovider | fbaadmin3'。任何其他方式?

回答

1

我不認爲你可以通過SP Web服務獲取它。您必須直接使用角色提供者接口來查詢角色。由於並非所有功能都已在其「代理」成員資格提供程序中實施,因此在SharePoint 2010中也有一些使用成員資格和角色提供程序的捕獲。我建議查看FBA包中的代碼,瞭解如何執行此操作的一些示例。 Utils.cs和UserEdit.aspx.cs應該有一些很好的例子給你:

http://sharepoint2010fba.codeplex.com/SourceControl/changeset/view/458f208d6152#Visigo.Sharepoint.FormsBasedAuthentication%2fVisigo.Sharepoint.FormsBasedAuthentication%2fCode%2fUtils.cs

http://sharepoint2010fba.codeplex.com/SourceControl/changeset/view/458f208d6152#Visigo.Sharepoint.FormsBasedAuthentication%2fVisigo.Sharepoint.FormsBasedAuthentication%2fLayouts%2fFBA%2fMANAGEMENT%2fUserEdit.aspx.cs

+0

感謝您的答覆。使用SP對象模型是我會考慮的選項之後將會知道標準Web服務在我的情況下是無用的.. –

相關問題