Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
User Authentication
ajunuthula
<p>Hi,</p><p> </p><p>Is there a way that I can restrict access to the reports for different users?</p><p>The following .rptdesign point to different report designs:</p><p><a data-ipb='nomediaparse' href='
http://wisdom.rockefeller.edu:8080/birt/frameset?__report=Database.rptdesign'>http://wisdom.rockefeller.edu:8080/birt/frameset?__report=Database.rptdesign</a></p><p> </p><p>How
can theese reports be restricted access to different users.</p><p> </p><p>Also, is there a way that all the reports can be viewed to users with role 'admin' and few reports visible to</p><p>users with role '****' and so on.</p><p> </p><p>Thank you,
Aparna J</p><p> </p>
Find more posts tagged with
Comments
kclark
<p>How will you be getting the username? Depending on how the username is received you could pass it an an encrypted hidden parameter to the report. Then the report could decrypt the username and decide if the report should be seen or forward them to an authentication error page using the text item.</p>
ajunuthula
<p>I am just thinking of a way, not sure if it works.</p><p>I will be desiging a report with parameters username and password.</p><p>Once the user enters username and password and click ok, can I issue a query to search for the user in the database table and if yes, then forward to the next report or else just go another report displaying invalid........</p><p> </p><p>If this scenario does not work, am thinking of writing a servlet for user authentication:</p><p> </p><p>Thank you,</p>
ajunuthula
<p>Hi,</p><p> </p><p>I cannot open this link:</p><p> </p><p><span><a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1542-data-engine-api-to-check-data-set-values/'>http://www.birt-exchange.org/org/devshare/designing-birt-reports/1542-data-engine-api-to-check-data-set-values/</a></span></p><p> </p><p><span>I
need to make sure that only certain users are able to view our BIRT reports via the web viewer.</span><span>am thinking of performing the restriction within the report itself.</span> Someone posted this article but cannot open it.</p>
kclark
<p>One was to do this would be with a computed column. I created a test mysql database with some usernames and password. And used this query</p><pre class="_prettyXprint">select username, passwordfrom user_list</pre><p>Then I created two parameters called username and password. Then I created a Boolean computed column that checks to see if the username/password combination provided in the parameters matches anything in the database.</p><pre class="_prettyXprint">if(params["UserName"].value == row["username"] && params["Password"].value == row["password"]) { true;}else{ false;}</pre><p>Then in the initizilize of the report I set a PGV to true.</p><pre class="_prettyXprint">reportContext.setPersistentGlobalVariable("fail", "true");</pre><p>Then created a hidden table from the username/password dataset and checked to see if any of them matched in the onCreate of the computed column.</p><pre class="_prettyXprint">if(this.getValue() == true) { reportContext.setPersistentGlobalVariable("fail", "false");}</pre><p>Finally, I check the PGV in a text item. If the PGV fail is set to true then it's forwarded to google or whatever page you want to send them to, otherwise they are welcomed.</p><pre class="_prettyXprint">if(reportContext.getPersistentGlobalVariable("fail") == "true") { this.text = "<html><body><script>window.location='http://www.google.com';</script></body></html>";}else{ this.text = "Welcome!";}</pre>
ajunuthula
<p>Hi,</p><p> </p><p>Thank you so much for the response and I tried it but even when the password does not match, still the google url is being opened.</p><p> </p><p>Am trying to attach the .rptdesign but getting an error.</p><p>Is there any way that I can send you the report deisgn that I created?</p><p> </p><p>Can you please guide me where I went wrong.</p><p> </p><p>Thank you.</p>
kclark
<p>From our conversation in email the solution to this was to put</p><pre class="_prettyXprint">if(reportContext.getPersistentGlobalVariable("fail") == "true") { this.text = "<html><body><script>window.location='http://www.google.com';</script></body></html>";}else{ this.text = "Welcome!";}</pre><p>In the onCreate() of your text item.</p>