2013-10-09 56 views
4

我開發了一個自定義安全擴展,以便從Intranet產品到報告服務進行單點登錄。它直到我來訂閱時才起作用。使用自定義安全擴展在SSRS中訂閱錯誤

發展也喜歡這裏建議: http://msdn.microsoft.com/en-us/library/ms155029.aspx

登錄,上傳和管理報告工作。每個用戶都可以閱讀和打開報告。 我們也實現了授權和overrite的功能,如這裏所描述: http://msdn.microsoft.com/en-us/library/ms152800.aspx

管理文件夾,報告工作爲好。

當我訂閱了一份報告以通過電子郵件發送報告時,系統表示該用戶沒有足夠的權限向該報告發送電子郵件。

notification!WindowsService_0!1674!10/09/2013-14:02:04:: i INFO: Handling subscription f70f374e-28fa-4ba2-8b0e-6633f1299ee9 to report Projekt Aufwand, owner: rausch, delivery extension: Report Server Email. 
library!WindowsService_0!1674!10/09/2013-14:02:04:: i INFO: RenderForNewSession('/Projektverwaltung/Projekt Aufwand') 
library!WindowsService_0!1674!10/09/2013-14:02:04:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: , Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: Die dem Benutzer 'rausch' erteilten Berechtigungen reichen zum Ausführen des Vorgangs nicht aus.; 
library!WindowsService_0!1674!10/09/2013-14:02:04:: i INFO: Initializing EnableExecutionLogging to 'True' as specified in Server system properties. 
emailextension!WindowsService_0!1674!10/09/2013-14:02:04:: e ERROR: Error sending email. Exception: Microsoft.ReportingServices.Diagnostics.Utilities.RSException: Die dem Benutzer 'rausch' erteilten Berechtigungen reichen zum Ausführen des Vorgangs nicht aus. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: Die dem Benutzer 'rausch' erteilten Berechtigungen reichen zum Ausführen des Vorgangs nicht aus. 
notification!WindowsService_0!1674!10/09/2013-14:02:04:: i INFO: Notification 6241f7f4-6225-44ea-b8ff-3654960ae218 completed. Success: True, Status: Fehler beim Senden von E-Mail: Die dem Benutzer 'rausch' erteilten Berechtigungen reichen zum Ausführen des Vorgangs nicht aus.E-Mails werden nicht erneut gesendet., DeliveryExtension: Report Server Email, Report: Projekt Aufwand, Attempt 0 

解決方法:我打開了Report Server數據庫的subscriptions表,並與報表服務器管理員的用戶ID替換OwnerIdUserId。然後訂閱運行在管理員權限下,並且工作。

任何人都知道我可以看/檢查設置正確的權限?或者我必須在CheckAccess覆蓋方法中添加一些代碼?代碼

部分:

m_RptOperNames.Add(ReportOperation.CreateSubscription, 
     OperationNames.OperCreateSubscription); 
    m_RptOperNames.Add(ReportOperation.DeleteSubscription, 
     OperationNames.OperDeleteSubscription); 
    m_RptOperNames.Add(ReportOperation.ReadSubscription, 
     OperationNames.OperReadSubscription); 
    m_RptOperNames.Add(ReportOperation.UpdateSubscription, 
     OperationNames.OperUpdateSubscription); 
    m_RptOperNames.Add(ReportOperation.CreateAnySubscription, 
     OperationNames.OperCreateAnySubscription); 
    m_RptOperNames.Add(ReportOperation.DeleteAnySubscription, 
     OperationNames.OperDeleteAnySubscription); 
    m_RptOperNames.Add(ReportOperation.ReadAnySubscription, 
     OperationNames.OperReadAnySubscription); 
    m_RptOperNames.Add(ReportOperation.UpdateAnySubscription, 
     OperationNames.OperUpdateAnySubscription); 

在這裏,我搬到了調查整個C#類代碼:https://docs.google.com/file/d/0B02JCr49NYlUeDFVbWt2NVdpUmc/edit?usp=sharing

我看不出有任何執行或電子郵件訂閱,但它不是參考的一部分碼。情況會是這樣嗎?

編輯

見此情景:http://msdn.microsoft.com/en-us/library/bb283182.aspx 誰能告訴我的權利是需要通過電子郵件訂閱什麼項目?然後,我可以更深入地瞭解項目需要授予的內容。

UPDATE

我仍然有這個問題,但我有點聰明瞭:)。 實際上,電子郵件傳遞由WindowsService報告服務器使用的Microsoft.ReportingServices.Library.TimedSubscriptionHandler處理。

如果使用指向報告的鏈接設置訂閱,則只有訂閱可以使用CustomSecurity擴展! 添加報告使系統呈現報告。報表服務器將創建一個新的會話,並且不授予權限。我無法確定自定義安全擴展的繼承是否可以在這裏工作。

也許一些SSRS/.NET大師有一些提示,尋求網絡小時並沒有給我任何解決方案。

解決方法:此刻,我在訂閱上設置了一個觸發器,並用Admin id替換OwnerId。

CREATE TRIGGER Subscription_overwrite_owner 
    ON dbo.Subscriptions 
    AFTER INSERT, UPDATE 
AS 
BEGIN 
    -- replace the OwnerId with the uid from the admin account 
    -- so the TimedSubscription runs with correct credentials 
    UPDATE dbo.Subscriptions SET OwnerID = 'uuid admin from Users table' 
END 
GO 

回答

2

我更喜歡別人找到答案,但自從幾個月以來沒有人繼續調查問題是什麼。最後,獲勝者是......

沒有評論我使用了示例項目來實現自定義seecurity擴展。

我讓它在我的環境中工作!

  1. 我沒有設置一個安全擴展witht他品嚐CustomSecurity 項目
  2. 一切工作只是罰款訂閱如果它們包含attachemnts(如呈現的報表)。
  3. 我後來發現它在RSReportServer.config管理員用戶設置 (<Security><Configuration>這是 負載fromthe SetConfiguration設置。
  4. 示例項目告訴我們,我們存儲在 的web.config應用程序設置工作!

我做了很多店面參數在web.config我的自定義安全擴展!

所有工作正常,在前端和渲染的報告。但是,當涉及到下標帶有附件的離子會遇到許可錯誤...

它適用於管理員,因爲如果用戶是管理員,CustomSecurity示例項目授予訪問權限!

但ReportServicesService.exe沒有從web.config中獲取配置數據!

這就是爲什麼我的所有CheckAccess()方法都未能檢查其他安全設置,因爲在我們存儲的web.config中,連接字符串,如果我們用來獲取自定義數據庫。

因此,您現在可以重寫代碼並將所有配置數據從web.config移動到rsreportserver.config文件中。

或者您也可以將您的web.config應用程序也添加到/bin/ReportingServicesService.exe.config。

在我的情況e.g:

<configuration> 
    <configSections> 
    <section name="RStrace" type="Microsoft.ReportingServices.Diagnostics.RSTraceSectionHandler,Microsoft.ReportingServices.Diagnostics" /> 
    <!-- custom authentication start --> 
    <section name="CustomSecurity" requirePermission="false" /> 
    <!-- custom authentication end --> 
    </configSections> 
    <!-- custom authentication start --> 
    <appSettings> 
    <add key="log" value="d:\log"/> 
    <add key="multi_company" value="true"/> 
    <add key="default_domain" value="fqdn.domain.de"/> 
    <add key="connection" value="database=ReportServer;server=(local);uid=sa;pwd=secret;" /> 
    </appSettings> 
    <!-- custom authentication end --> 

這是寫任何地方和我花了一段時間才能找出答案......

希望幫助大家使用自定義窗體身份驗證和SSRS工作。

+0

我們是一個獨立的社區,勇於創建自定義的SSRS安全擴展!非常感謝您發佈此信息 - 網絡上幾乎沒有關於SSRS自定義安全擴展的信息,甚至更少關於計劃報告的副作用。 – Matthew

+0

很高興看到我的帖子結果幫助其他人遇到同樣的問題。 – YvesR