roles & permissions newbie question
I know this has been done, but I don't know how to do it myself. I'm trying to write a html page where some parts gets displayed only if the user has logged in. If the person is not logged in, it should display some generic text, with perhaps a "login" button somewhere. I'm also trying to do this from an external method. For one thing, I'm not sure if I need to add another role or another permission. I can't seem to be able to add another permission, I only see the ability to add a user role. So I tried that, and used SecurityManager.validate(). But it forces you to login, whereas I want a more passive approach. Thanks, Albert
Albert Ting writes:
I know this has been done, but I don't know how to do it myself. I'm trying to write a html page where some parts gets displayed only if the user has logged in. If the person is not logged in, it should display some generic text, with perhaps a "login" button somewhere. Look at the methods in "AccessControl.DTML". They allow you check various aspects of the current user.
I'm also trying to do this from an external method. It is very nasty, that the methods of "AccessControl.DTML" are not exposed to Python Scripts and External Methods. Someone did not think enough at this point...
There is an alternative way: getSecurityManager. It is defined in "AccessContol" and returns a "SecurityManager". It, too, allows to check various aspects of the current user. It can be accessed from Python Script and External Method but not easily from DTML.... Dieter
participants (2)
-
Albert Ting -
Dieter Maurer