Yve*_*esR 5 c# permissions customization reporting-services
我开发了一个自定义安全扩展,以使从我们的Intranet产品到报告服务的单一登录。在我订阅之前,它就像一种魅力。
开发确实像这里建议的那样:http : //msdn.microsoft.com/en-us/library/ms155029.aspx
登录,上传和管理报告有效。每个用户都可以阅读和打开报告。我们还实现了授权并覆盖了此处描述的功能:http : //msdn.microsoft.com/zh-cn/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
Run Code Online (Sandbox Code Playgroud)
解决方法:我subscriptions在ReportServer数据库中打开表,然后将其替换OwnerId UserId为报表服务器管理员的userId。然后,订阅将在管理员权限下运行,并且可以正常工作。
有人知道我可以在哪里查看/检查以设置正确的权限吗?还是我必须在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);
Run Code Online (Sandbox Code Playgroud)
在这里,我移动了整个c#类代码以进行调查:https : //docs.google.com/file/d/0B02JCr49NYlUeDFVbWt2NVdpUmc/edit?usp=sharing
我没有看到任何执行或电子邮件订阅,但这不是参考代码的一部分。可能是这样吗?
编辑
看到以下内容:http : //msdn.microsoft.com/zh-cn/library/bb283182.aspx 谁能告诉我通过电子邮件发送订阅所需的权利吗?然后,我可以更深入地了解需要授予哪些项目。
更新
我仍然有这个问题,但是我现在有点聪明了。实际上,电子邮件传递是Microsoft.ReportingServices.Library.TimedSubscriptionHandler由WindowsService Reportserver使用的传递方式处理的。
如果您使用报表链接设置订阅,则即使使用CustomSecurity扩展,该订阅也只能使用!添加报告使系统呈现报告。报表服务器在那里创建一个新会话,并且那里没有授予权限。我还不确定自定义安全扩展的继承是否在这里起作用。
也许某些SSRS / .NET专家提供了一些技巧,但在数小时内寻求网络并没有给我任何解决方案。
解决方法:目前,我在订阅上设置了一个触发器,并将OwnerId替换为管理员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
Run Code Online (Sandbox Code Playgroud)
我更希望其他人找到答案,但几个月以来没有人继续调查问题所在。最后,获胜者是...
不说我使用示例项目来实现自定义安全扩展。
我让它在我的环境中工作!
<Security><Configuration>它是从 SetConfiguration 设置加载的)。web.config!我确实在 web.config 中存储了自定义安全扩展的许多参数!
前端和渲染报告一切正常。但是当涉及到带有附件的订阅时,我们会遇到权限错误......
它适用于管理员,因为如果用户是管理员,CustomSecurity Sample 项目就会授予访问权限!
但是 ReportServicesService.exe 没有从 web.config 获取配置数据!
这就是为什么我的所有 CheckAccess() 方法都无法检查其他安全设置,因为在 web.config 中,我们存储例如连接字符串(如果我们用于获取自定义数据库)。
因此,您现在可以重写代码并将所有配置数据从 web.config 移至 rsreportserver.config 文件中。
或者,您也可以将 web.config 应用程序添加到 /bin/ReportingServicesService.exe.config。
就我而言,例如:
<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 -->
Run Code Online (Sandbox Code Playgroud)
这没有写在哪里,我花了一段时间才弄清楚......
希望这对使用自定义表单身份验证和 SSRS 的每个人有所帮助。
| 归档时间: |
|
| 查看次数: |
896 次 |
| 最近记录: |