[Zope] Getting a specific user role
Jason Spisak
444@hiretechs.com
Thu, 08 Jun 2000 23:48:39 GMT
Mabe, Brad writes:
> Forgive me if this has been covered before.
There's no real great documentation on using the security API, and it's
changing a bit anyway.
>
> I am implementing a login/security scheme through the use of GUF and SQL
> methods. My user and role information is kept in a SQL database and a user
> can have more than one role assigned to him/her.
>
> What I would like to do is check if a specific role has been assigned to the
> current user, and then display some additional menu items if that role has
> been assigned. I haven't been able to figure out how to get and check the
> roles that have been assigned to the current user.
>
> As usual, any help will be greatly appreciated.
>
> -=Brad=-
try:
<dtml-if "AUTHENTICATED_USER.has_role('MyRole')">
My stuff
</dtml-if>
Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.