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)
Reports restricted based on the user roles
ajunuthula
<p>Hi,</p><p> </p><p>I have a table in the database that holds username , role type and department name, so based on the role type how can I restrict the reports.</p><p> </p><p>For example, user "A" with role 'admin' should see all the reports irrespective of the department.</p><p>user "B" with role 'user ' and department 'dept 1' must see the reports restricted only to that department.</p><p>user "C" with role 'user' but with departments 1 and 2, must be able to see the reports related to those two departments.</p><p> </p><p>Any adivise or suggestion on how to proceed.</p><p> </p><p>Thank you.</p>
Find more posts tagged with
Comments
black.water
<p>Scripting is your answer!</p><p> </p><p>Use a username parameter and scripting to create a scripted data set of departments to display (be sure elements are distinct). Left outer join it with your database to create a final data set you can display in your report. This should also naturally order your report by department which is always nice</p><p> </p><p>It is difficult to say one surefire method to script the displayed department data set as I'm not sure how your department information is stored in your database (string, array, duplicate usernames with different directories, etc.) Scripting may not be required based on how information is organized, you just need to get that list of departments into a temp data set so you can use it to outer join.</p><p> </p><p>enjoy! </p><p> </p>
ajunuthula
<p>Thank you for the suggestion.</p><p>Department information is stored as a column with String datatype and is distinct, no duplicates allowed.</p><p> </p><p>Am little confused, can you please explain it more briefly.</p><p> </p><p>Thank you.</p>
black.water
<p>Does the string in each row contain a single department or multiple?</p><p> </p><p>In other words, how is example user C's information stored?</p><p> </p><p>Super briefly, Once you get a list of departments to display (scripted) use it to create a data set of report information, then display info as you wish.</p><p> </p><p>^ obviously vague, but just specify which part(s) you want explained better and ill do my best</p>
ajunuthula
<p>Thank you.</p><p>For now we will be dealing with one user one department, will figure out for multiple departments.</p><p> </p><p>So I shoud create a dataset with departments. Based on this, should display the reports using conditions?</p><p>Is there any way that we can show/hide the report design itself just as we do for table columns...?(visibility property).</p><p> </p><p>Thank you.</p>
black.water
<p>Are you familiar with the joint table BIRT feature and joins? A left outer join between a <strong>department name only </strong>set and an <strong>all information</strong> set (joined by the mutual department name column) should result in a data set consisting of only information for the department desired. Let me know if you need further clarification on joint tables or outer joins.</p><p> </p><p><a data-ipb='nomediaparse' href='
http://birtworld.blogspot.com/2006/05/joined-data-sets-with-birt-21.html'>http://birtworld.blogspot.com/2006/05/joined-data-sets-with-birt-21.html</a></p><p><a
data-ipb='nomediaparse' href='
http://www.w3schools.com/sql/sql_join.asp'>http://www.w3schools.com/sql/sql_join.asp</a></p><p> </p><p>To
my knowledge there is no way to hide table elements at runtime aside from extreme scripting, its easier to decide what data is withheld when given to the report template to display. A table join should restrict the output data appropriately</p>