I developed a custom security extension to have a single sign on from our intranet product to the reporting services. It works like a charm until I come to a subscription.
Development did like suggested here: http://msdn.microsoft.com/en-us/library/ms155029.aspx
Login, Upload and manage reports works. Every user can read and open reports. We also implemented authorization and overrite the functions like described here: http://msdn.microsoft.com/en-us/library/ms152800.aspx
Managing folder, reports works as well.
When I ad a subscription to render a report to deliver it via email the system say that the user do not have enough permission to email the report.
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
Workaround: I open the subscriptions
table in the ReportServer database and replace the OwnerId
UserId
with the userId of the report server administrator. Then the subscriptions runs under admin rights and it works.
Anyone know where I can look/check to set correct permissions? Or do I have to add some code in the CheckAccess overwrite methods?
Part of the code:
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);
Here I moved the whole c# class code for investigations: https://docs.google.com/file/d/0B02JCr49NYlUeDFVbWt2NVdpUmc/edit?usp=sharing
I do not see any Execution or Email subscription, but it was not part of the reference code. Could that be the case?
EDIT
Seeing this: http://msdn.microsoft.com/en-us/library/bb283182.aspx Can anyone tell me what Item right is needed to email a subscription? Then I can take a look deeper what Item needs to be granted.
UPDATE
I still have this issue but I am a bit wiser now :).
In fact the Email delivery is handled by Microsoft.ReportingServices.Library.TimedSubscriptionHandler
which is used by the WindowsService Reportserver.
If you setup a subscription with the link to the report only the subscription works even with the CustomSecurity extension! Add the report makes the system render the report. There the report server create a new session and there the permissions are not granted. I couldn't find out yet if the inheritance of the custom security extension works here or not.
Maybe some SSRS / .NET guru has some tips, seeking the net for hours did not give me any solutions.
Workaround: At the moment I setup a trigger on the subscriptions and replace the OwnerId with the Admin id.
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