his might already be possible in JasperServer, but I've experimented and searched the doc's to no avail.
I'm working on reporting in a fairly large company. We have about 150 people receiving various forms of information. Of course not all of them should be allowed to look at all info. A team-manager should only be able to review the salaries
of his own workers, not of the board of directors.
One way to do this would probably be to create a report and put it in the server one time for each department. Then
assign rights on JasperServer to allow or dissalow each incarnation of the report. But, as you can imagine, for 100
departments this gets too complex.
In my opinion the ideal way to make this happen is to create an input-parameter that is a list of only the departments a
person is allowed to create a report over. We have a list of departments and the users that can see the reports over
those departments. So that would mean a drop-down-list that has a source like this:
select department_code
from user_departments
where username = $P{LoggedInUser}
Note that, as you can see, some users are allowed to access more than one department.
Your thoughts would be greatly appreciated.
Kind regards,
Arian Prins.
<queryString>SELECT .. WHERE .. $P{LoggedInUsername} ..</queryString>
(0006513)
anandharaj
04/01/2009 06:00
Ok, for the "input control" there will be some workaround which will provided by Jasper team
(0008241)
swood
11/11/2009 04:57
This was done as part of cascading input controls.
Parameter Name Type Notes
LoggedInUser User Not usable in query input control, but is used as parameter to report
LoggedInUsername String Of logged in user
LoggedInUserFullName String Of logged in user
LoggedInUserEmailAddress String Of logged in user
LoggedInUserEnabled Boolean Is logged in user enabled?
LoggedInUserExternallyDefined Boolean Is logged in user externally defined? ie. authenticated externally
LoggedInUserTenantId String Of logged in user. Only relevant in Pro/Enterprise.
LoggedInUserRoles Collection<String> Current set of roles of logged in user. Useful for $X parameter
LoggedInUserAttributes Map<String, String> Not usable in query input control, but is used as parameter to report. Empty map if no attributes
LoggedInUserAttributeNames Collection<String> User profile attribute names. Useful for $X parameters. Empty collection if no attributes
LoggedInUserAttributeValues Collection<String> User profile attribute values. Useful for $X parameters. Empty collection if no attributes
LoggedInUserAttribute_<attribute name> String Attribute value for matched attribute name (like "att1") on the user. Empty string if no match.
Only provided if defined in a query or as a report parameter. No
Include these as you would do in a JasperReport query: $P{}, $X} (for SQL), $P!{}