[Zope-dev] has_role vs. hasRole
Stefane Fermigier
sf@fermigier.com
Mon, 23 Apr 2001 20:20:13 +0200
Hi,
a developer who's working with me has been bitten by the following fact
today, one year after me.
There are two methods on objects BasicUser.
One is called "has_role" and has the following docstring:
"""Check to see if a user has a given role or roles."""
The other one is called hasRole, is an alias on another method that's
called "allowed" and has the following docstring:
"""Check whether the user has access to object, assuming that
object.__roles__ is the given roles."""
(The Zope Book doesn't say anything on "has_role" (why?) but says about
"hasRole":
hasRole(object, roles) -- Return a value that is true if the user has the=
given
roles on the given object and return false otherwise.)
I understand that those two methods have differents signatures and differ=
ent
uses, but I think that the names are too similar to not induce confusion.
S.
--=20
St=E9fane Fermigier, Tel: +33 (0)6 63 04 12 77 (mobile).
http://nuxeo.com/ & http://portalux.com/ & http://aful.org/
"Amazon: we patent the dot in .com"