Take a look here:

http://jakarta.apache.org/jetspeed/site/portlet_config_Velocity.html

This lists what you have in the context for Velocity.  I think it is trivial
to create a macro
that will return the UserRole by calling
JetspeedSecurityService.getRole(user.getUserName());

I haven't used velocity in a long while, but this is trivial operation with
jsp custom tags for sure.

Dmitry

-----Original Message-----
From: Prasad A Navalimath [mailto:[EMAIL PROTECTED]
Sent: Friday, January 23, 2004 2:18 PM
To: 'Jetspeed Users List'; 'Craig Connell'
Subject: RE: How to get Role name ?
Importance: High


Thanks for reply :-)  actually I was try to find a way in .vm files
(velocity template files). So that while displaying the vm file, I will
check whether the role is "admin" or "role1" or "role2", and decide whether
to display the portlet content or hide part of it.

Or if there any sophisticated way to do access controlling in jetspeed
please correct me.

Actually I want to have at least 4 different type of users, admin (who a
super user), HomePageAdmin (who will load or decide the general content of
web page for users), normal users, and lastly anonymous users.

Anonymous user will just navigate the portal.

Normal users will login but only view the pages (no customization), based on
their role (say, employee or customer of a company), they will see different
content.

HomePageAdmin will change the content of the portlet, upload any new
portlet.

Admin will create new users a/c, or does any sort super user job.

So to accomplish the above task, I was planning to know the rolename, so
that I can control the access to the display of portlets. I know with this
solution I am troubling my to make the admin change the code to some extent,
whenever a new portlet is added.


Looks like your solution may work in java program. Its 00:30 now, I am
feeling sleepy, & I need to go to home & sleep. So I will try tomorrow.


Looking forward for some solution for the problem in the task described
above.


Thanks anyway,
Prasad A Navalimath.



-----Original Message-----
From: Craig Connell [mailto:[EMAIL PROTECTED] 
Sent: Friday, 23 January, 2004 23:46
To: 'Jetspeed Users List'
Subject: RE: How to get Role name ?

Try:

        JetspeedSecurityService.getRole(user.getUserName());

That should work for you.

Craig 

-----Original Message-----
From: Prasad A Navalimath [mailto:[EMAIL PROTECTED]
Sent: Friday, January 23, 2004 11:55 AM
To: 'Jetspeed Users List'
Subject: How to get Role name ?
Importance: High


Hi all,

My requirement is :
User1 -- who can customize its home page. This person role name is "role1"
User2 -- This person should only be able to view pages same as home page of
user1, ie., no customization links at all. This person role name "role2".


How I am planning to implement this is, --

*. login as admin, create user1. Attach user1 with role1, who can customize
its pages.

*. Login as user1, customize its home page to display portlet 1 and
portlet2.

*. Login as admin, Create user2. Attach user2 with role2, who can just view
its pages.
 Now copy the psml files of user1 to user2's directory. So that what user2
sees is same as user1.

Now edit the .vm file, try to check if the role name is "role2", then
display portlet1 only WITHOUT customization option available, ie., only able
view portlet1, but NOT portlet2.

So I tried to display a portlet by title "JSLINK Examples" with description
"$jslink examples", that can display all the value from jslink. And in that
its displaying $jslink.RoleName value as it is.

So how to get value of role name ??????

Thanks in advance for any solurion/suggestion,
Prasad A Navalimath.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to