How to use LooggedInUser for getting role

0

Hi,

How can i use LoggedInUser for getting Role of the user.

I

com.jaspersoft.jasperserver.api.metadata.user.domain.User

I understand thats a SET but then
How can i get name(string) of role in the report.

Regards,

Raman



Post Edited by ramandeep1980 at 03/25/2010 11:03
ramandeep1980's picture
Joined: Jan 22 2009 - 10:27pm
Last seen: 3 years 8 months ago

5 Answers:

0
$P{LoggedInUser}.getRoles() will return a collection of the current user roles

try this:
($P{LoggedInUser}.getRoles().toArray()[0]).getRoleName() will return the first role assigned to the user.


malek's picture
40
Joined: Jun 29 2009 - 2:54am
Last seen: 8 years 5 months ago
0

Hi Malek,
No it wont work that wat.I have foind the way to make it work it is below:-


This will work for gettng the role

Raman



Post Edited by ramandeep1980 at 03/25/2010 11:02
ramandeep1980's picture
Joined: Jan 22 2009 - 10:27pm
Last seen: 3 years 8 months ago
0

Hello

Where is the solution ?

I'm interested by the soltion ;-)

Thx

iniste's picture
2
Joined: Dec 3 2010 - 5:13am
Last seen: 10 years 4 months ago
0

Did you look at this thread:
http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=82399&topid=82469

That's an example that does getTenantId. But you could call getRoles() at the end instead.

Regards,
Matt

mdahlman's picture
14552
Joined: Mar 13 2007 - 2:43am
Last seen: 6 years 5 months ago
0

Hi,

If you have solution i need it ASAP.

Thank you for your help.

 

iniste's picture
2
Joined: Dec 3 2010 - 5:13am
Last seen: 10 years 4 months ago
Feedback