SSRS 2017 Web.config权限

时间:2017-11-14 14:33:10

标签: reporting-services reporting-services-2016

我的SSRS 2017报告经理遇到了问题。我已经实现了找到的样本here,除了从门户网站(服务器很好)外,它似乎都有效。我发现解决方案是服务用户需要具有web.config的写权限才能从RSReportingServices.config复制machinekey。

我该怎样绕过这个?我已经尝试手动写入web.config但rshostingservice仍尝试同步密钥并失败。

1 个答案:

答案 0 :(得分:0)

我希望能够避免写入权限的需要。我通过向运行ssrs的服务授予写入权限来解决我的问题。我使用以下代码来授予所需的权限

        try
        {
            var fileSecurity = File.GetAccessControl(Path);
            var user = ServiceUserDetails();
            fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.Write,
                AccessControlType.Allow));
            fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.Read,
                AccessControlType.Allow));
            fileSecurity.AddAccessRule(new FileSystemAccessRule(user, FileSystemRights.ReadAndExecute,
                AccessControlType.Allow));
            File.SetAccessControl(Path, fileSecurity);
        }
        catch
        {
            MessageBox.Show(@"Error",
                $@"Unable to set permissions for {Path}. Please ensure service has write permission");
        }