Checking / Redirecting on Permission Denied (rsAccessDenied) aka Checking Security on SSRS Report Render
hi crew we have many asp.net application pointing to reporting services reports. some are linked, others are displayed within an iframe. we use SSRS's built in security to limit access to certain reports- users can request access via our information security team (and a custom app we wrote). the problem is that user click into or view reports that they dont have access to, they get an unfriendly rsAccessDenied error (see below). i searched online and did not find any solutions- though many people have the same problem. i figure a custom assembly might work, but i cannot edit & test hundreds or RDLs. i came up with this quick & dirty javascript solution (below). it sits in the ReportViewer.aspx and looks for the 'error div' that gets generated. in this case- if passes the report name to our permission granted app- but you could email someone, etc. the default error message doesnt even say what RDL they are viewing! the problem with the solution is it doesnt work for two common scenarios; ie- the same reportviewer.aspx doesnt seem to be rendering the content: works: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render fails (passing in parameter values): http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&PARARMNAME=1&PARAMNAME=2&rs:Command=Render fails (don't use reportview.aspx??) : http://server/ReportServer?reportname can you assist? CJ --2008R2 <script type="text/javascript"> var rptDivString=document.getElementById('ReportViewerControl_ctl10_NonReportContent').innerHTML; var numPermError = rptDivString.search(/the permissions granted/i); if (numPermError>0) { var docTitle = document.title; var reportName = docTitle.substr(0,docTitle.length-16); alert('Reporting Services permissions error in report: ' + reportName + '\nYou will now be redirect to SomeApp to request permissions.'); window.open('http://server/someapp/default.aspx?report=' + escape(reportName) + '&request_access=1','_blank','left=20,top=20,width=1000,height=600,location=1,toolbar=1,resizable=1,scrollbars=1'); } </script> --2005 <script type="text/javascript"> var rptDivString=document.getElementById('ReportViewerControl').innerHTML; var numPermError = rptDivString.search(/the permissions granted/i); if (numPermError>0) { var docTitle = document.title; var reportName = docTitle; alert('Reporting Services permissions error in report: ' + reportName + '\nYou will now be redirect to SomeApp to request permissions.'); window.open('http://server/someapp/default.aspx?report=' + escape(reportName)+ '&request_access=1','_blank','left=20,top=20,width=1000,height=600,location=1,toolbar=1,resizable=1,scrollbars=1'); } </script>
October 19th, 2011 5:26pm

Hi bigluzer2, Pass parameter to Report through URL in SSRS, please take the following format: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render &PARARMNAME=1&PARAMNAME=2 For more information about it, please refer to the following article: Using URL Access Parameters: http://msdn.microsoft.com/en-us/library/ms152835.aspx As for the rsAccessDenied error, please refer to the following link: Fixing a rsAccessDenied with the ReportViewer control: http://www.certsandprogs.com/2009/11/fixing-rsaccessdenied-with-reportviewer.html#axzz1bIuBsB2b If the issue still persists, please post the question to Visual Studio Report Controls forum: http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ If you have any question, please feel free to ask. Thanks, Eileen Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2011 3:36am

Hi bigluzer2, Pass parameter to Report through URL in SSRS, please take the following format: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render &PARARMNAME=1&PARAMNAME=2 For more information about it, please refer to the following article: Using URL Access Parameters: http://msdn.microsoft.com/en-us/library/ms152835.aspx As for the rsAccessDenied error, please refer to the following link: Fixing a rsAccessDenied with the ReportViewer control: http://www.certsandprogs.com/2009/11/fixing-rsaccessdenied-with-reportviewer.html#axzz1bIuBsB2b If the issue still persists, please post the question to Visual Studio Report Controls forum: http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ If you have any question, please feel free to ask. Thanks, Eileen Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
October 20th, 2011 10:19am

Hi bigluzer2, Pass parameter to Report through URL in SSRS, please take the following format: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render &PARARMNAME=1&PARAMNAME=2 For more information about it, please refer to the following article: Using URL Access Parameters: http://msdn.microsoft.com/en-us/library/ms152835.aspx As for the rsAccessDenied error, please refer to the following link: Fixing a rsAccessDenied with the ReportViewer control: http://www.certsandprogs.com/2009/11/fixing-rsaccessdenied-with-reportviewer.html#axzz1bIuBsB2b If the issue still persists, please post the question to Visual Studio Report Controls forum: http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ If you have any question, please feel free to ask. Thanks, Eileen Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Free Windows Admin Tool Kit Click here and download it now
October 20th, 2011 10:19am

Hi bigluzer2, Pass parameter to Report through URL in SSRS, please take the following format: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render &PARARMNAME=1&PARAMNAME=2 For more information about it, please refer to the following article: Using URL Access Parameters: http://msdn.microsoft.com/en-us/library/ms152835.aspx As for the rsAccessDenied error, please refer to the following link: Fixing a rsAccessDenied with the ReportViewer control: http://www.certsandprogs.com/2009/11/fixing-rsaccessdenied-with-reportviewer.html#axzz1bIuBsB2b If the issue still persists, please post the question to Visual Studio Report Controls forum: http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ If you have any question, please feel free to ask. Thanks, Eileen Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com. hi thank you for the repsponse 1) i know had to pass parameters via the URL. my issue is that the rendering tool seems different depending wether or not i pass params. 2) the rsaccessdenied i am getting is not unexpected- i just want to capcture it i recreated the thread in the other forum thanks c
November 1st, 2011 7:24pm

Hi bigluzer2, Pass parameter to Report through URL in SSRS, please take the following format: http://server/ReportServer/Pages/ReportViewer.aspx?ReportName&rs:Command=Render &PARARMNAME=1&PARAMNAME=2 For more information about it, please refer to the following article: Using URL Access Parameters: http://msdn.microsoft.com/en-us/library/ms152835.aspx As for the rsAccessDenied error, please refer to the following link: Fixing a rsAccessDenied with the ReportViewer control: http://www.certsandprogs.com/2009/11/fixing-rsaccessdenied-with-reportviewer.html#axzz1bIuBsB2b If the issue still persists, please post the question to Visual Studio Report Controls forum: http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/threads/ If you have any question, please feel free to ask. Thanks, Eileen Forum Support Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com. hi thank you for the repsponse 1) i know had to pass parameters via the URL. my issue is that the rendering tool seems different depending wether or not i pass params. 2) the rsaccessdenied i am getting is not unexpected- i just want to capcture it i recreated the thread in the other forum thanks c
Free Windows Admin Tool Kit Click here and download it now
November 1st, 2011 7:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics