|
|
|
|
|
|
JasperServer
 
0001315: using LoggedInUser in inputquery - JasperForge
  
Recently Visited: 0004006, 0003541, 0002732, 0000807, 0004738

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001315 [JasperServer] Feature Requests minor always 08/29/2007 00:23 03/11/2010 00:31
Reporter tcloonan  
Assigned To tcloonan
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.7.0 Product Version
  Target Version 3.7.0 Product Build
Summary 0001315: using LoggedInUser in inputquery
Description 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.
Steps To Reproduce
Additional Information
Tags Input Controls, Report Execution
Components Report Execution
Attached Files

- Relationships

-  Notes
(0001660)
mryzhikova
06/28/2008 02:12

Feature has been added in JS 2.1. Closing this bug. Thank you!
(0001659)
teodord
07/01/2008 12:51

It was closed by mistake. Reopening.

Thanks,
Teodor
(0006330)
anandharaj
03/17/2009 11:21

Isn't it this feature already available in Jasper?

&ltparameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User"/>

&ltparameter name="LoggedInUsername" isForPrompting="false">
  &ltdefaultValueExpression>$P{LoggedInUser}.getUsername()
  &lt/defaultValueExpression>
&lt/parameter>

&ltqueryString>SELECT .. WHERE .. $P{LoggedInUsername} ..&lt/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!{}
(0008948)
swood
03/11/2010 00:31

In 3.7.0 release

- Issue History
Date Modified Username Field Change
03/17/2009 11:21 anandharaj status_id 10 => 90
07/23/2009 00:27 swood Tag Attached: Input Controls
07/23/2009 00:27 swood Tag Attached: Report Execution
07/23/2009 23:51 swood Components => Report Execution
11/11/2009 04:57 swood Note Added: 0008241
11/11/2009 04:57 swood Status assigned => resolved
11/11/2009 04:57 swood Resolution open => fixed
11/11/2009 04:57 swood Fixed in Version => 3.7.0
11/11/2009 04:57 swood Target Version => 3.7.0
03/11/2010 00:31 swood Note Added: 0008948
03/11/2010 00:31 swood Status resolved => closed
 
 
JasperForge Quotes
"JasperReports is what CF uses under the hood."
 
Founding Member, Open Solutions Alliance       Hot Jasper Projects on SOURCEFORGE.NET       Powered by EssentiaESP