[Zope-Coders] Re: "Anonymous" role is pretty bizarre?
Tres Seaver
tseaver at zope.com
Mon Mar 22 17:21:28 EST 2004
Chris McDonough wrote:
> On Mon, 2004-03-22 at 12:05, Chris Withers wrote:
>
>>Chris McDonough wrote:
>>
>>>FWIW, I think the "Anonymous" role is pretty bizarre,
>>
>>How so?
>
>
> It's the only role that is meant to apply to a single system user and
> one of two (with Authenticated) which cannot be granted to normal
> users. Think about it.
Both of those roles are logically groups to whom permissions are
assigned: the 'Anonymous' role is actually an 'Everyone' group, with
special-cased optimizations based on that fact littered throughout the
code. The 'Authenticated' role is really a group consisting of
'Everyone' minus the one-and-only 'Anonymous User'.
Getting the terminology straght is hard, especially after we have all
bent our brains not to fight with Zope's machinery.
'Principal' -- an identifiable user, or group of users, to whom
privileges are granted.
'User' -- a single principal, associated with a request. Each request
has exactly *one* user, who may be the "nobody" user.
'Group' -- a collection of principals (perhaps including other
groups!)
'Role' -- an abstraction representing the granting of one or more
privileges to a given principal.
'Permission' -- a single privilege, defined by the software developer.
'Permission set' -- a rolled-up set of permissions, designed to be
presented as a single chunk in the UI.
<pre class="sop-to-mail-readers-with-non-monospace-fonts">
+---> Principal<-------->Role<-------->Privilege <-------+
| * ^ * * * * ^ * |
| /_\ /_\ |
| | | |
| | | |
| +---+----+ +------+------+ |
| | | | | |
+-<>Group User Permission PermissionSet<>-+
</pre>
In Zope, roles are often warped into either 'groups' or 'permission
sets', when in fact they are a third thing altogether (this confusion
arises largely because classic Zope2 has neither groups nor permission
sets).
Zope3 has already disentangled this mess to some extent; Jim has
expressed some hope that we might be able to migrate its cleaner model
back into some version of Zope2. Zope3 does allow for grants of
privileges "directly" to principals, with no explicit role; it makes
this choice because many people find such grants "natural". I would
prefer to model that grant as being made a an "eponymous" role, but
maybe I am just fussy. ;)
OTOH, the "Anonymous" role which this sub-thread is about is almost such
a role, so perhaps not.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-Coders
mailing list