[Zope] hasRole vs. has_role
   
    Florent Guillaume
     
    fg@nuxeo.com
       
    Fri, 17 May 2002 13:00:42 +0000 (UTC)
    
    
  
hasRole is deprecated, see in AccessControl.User:
        warnings.warn('BasicUser.hasRole is deprecated, please use '
            'BasicUser.allowed instead; hasRole was an alias for allowed, but '
            'you may have ment to use has_role.', DeprecationWarning)
Florent
Ulrich Wisser  <u.wisser@publisher.de> wrote:
> I ran into some problems with these two methods. What is the
> difference between them?
> 
> Here my problem:
> User has role 'PLAYER' but *not* 'MODERATOR'
> 
>   <dtml-unless "_.SecurityGetUser().has_role('MODERATOR')">
>     Has role MODERATOR
>   </dtml-unless>
> 
> doesn't print. Which is what I exspected. But
> 
>   <dtml-unless "_.SecurityGetUser().hasRole('MODERATOR')">
>     Has role MODERATOR
>   </dtml-unless>
> 
> does print the message. Why?
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com