cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

restricting sections of an IRPT

Former Member
0 Likes
191

I would like to hide a form and an applet on a user's screen if the user is not part of a role that has access to it. How can I do this?

I know how to get the username (<p></p>), but how can I get the role and are there any other universal xMII params like this that I should be aware of?

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Here are the built-in session properties, and an example of their value:

IllumLoginName - localadmin

Description - Default Localhost User

Machine - 127.0.0.1

FullName - Localhost Administrator

Language - en

IllumLoginRoles - Administrators,Developers,Everyone

You'll note that the roles are a comma separated list of all roles the user is a member of.

- Rick

Former Member
0 Likes

Ok I got that. Guide me on how to hide applets and html forms

Former Member
0 Likes

To hide a form:

document.myForm.style.visibility = "hidden";

To hide an applet:

document.myApplet.style.visibility = "hidden";

If the applet is part of the form, you just need to hide the form. To show either element after hiding, change the "hidden" to "visible".

Former Member
0 Likes

Just be forewarned that even if it is hidden, it will still attempt to run and access the data...and that not all JVM versions behave nicely with "hidden applets" - sometimes they do, sometimes they don't...

A more robust approach might be to create a JSP page that built the page dynamically from the server side (since the xMII parameters are simply web session parameters, you can access them by name in JSP as you would any other session values).

Since I'm a BLS fan, I'd probably do it with BLS and have the page be entirely "virtual" and streamed back from BLS. I'd build the individual sections as HTML snippets, load them/concatenate them within BLS based on the users' roles.

You can pass the user's roles into a BLS service by using the "AutoBind" capabilities and defining a string transaction input named IllumLoginRoles.

A third option would be do dynamically build the page from the client side using DHTML and document.write, but that might be a maintenance nightmare.

- Rick

Former Member
0 Likes

Yes, very good point. In the Best Practice document (available on the SDN) says not to hide the applets for this reason, I think.

Answers (1)

Answers (1)

Former Member
0 Likes

Hello xMII_Training ;*)

check out this part of the Help Docs:

http://<servername>/LighthammerCMS/Help/Personalization/Personalization.htm

It gives you a list of the Login Session Cookies.

Former Member
0 Likes

Thanks for the session cookies. I guess I need help hiding the applet and forms. Since both is html, I am wondering what the proper syntax is.

Ask a Question