Jump to content
We've recently updated our Privacy Statement, available here ×

JasperReports Server Domains - How to obtain User Id


mark.richardson

Recommended Posts

Background:
We are utilizing a SAAS solution which includes the JasperReports Server. Since we are one of many clients using the SAAS product, we are limited in our ability to make changes at the server level.

We have been using Jaspersoft Studio for the past several months, building JRXML report files and uploading them to the report server.
We have been performing security validation by doing lookups of the value of the parameter LoggedInUserAttribute_UserId against   application tables.

We now wish to build server-level Domains and allow Ad Hoc reporting against those domains, but must retain the capability of determining the logged in user ID and doing row-level security in the domain query. I have found quite a number of articles and Q&As related to Domains but have not yet found an explanation of how to access the equivalent of LoggedInUserAttribute_UserId at the domain query level. It is not a Domain access security issue, but a row-level security issue based on the content of non-JasperReports tables.

Can anyone describe the method by which we can accomplish this?

Thank you.
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You can use row level security to achieve the thing you are trying to do.

In the security file for the domian, for row level security, you could do something like below; if there is a column for Logged In username in your domain tables

<filterExpression>PersonColumn == groovy('authentication.principal.username') </filterExpression>

If the logic is more complicated than this, then you have to write a custom groovy function and pass the LoggedInUsername as parameter like below

<filterExpression>CustomGroovyFunction(groovy('authentication.principal.username'))</filterExpression>

Custom groovy code for jasper server goes here:  [Jasper Installation]apache-tomcatwebappsjasperserver-proWEB-INFapplicationContext-semanticLayer.xml Location

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...