[Zope-CMF] Re: [dev] CMFActionIcons: permissions
Tres Seaver
tseaver at zope.com
Tue Apr 27 15:19:54 EDT 2004
yuppie wrote:
> Tres Seaver wrote:
>
>> Permissions, like exceptions, events, and interfaces, are part of the
>> "public API" of a product, and deserve to be highlighted.
>>
>> I actually prefer to have each product have its own 'permissions.py'
>> module, which either imports more generic permissions from elsewhere
>> (AccessControl.Permissions, CMFCore.{CMFCoreP,p}ermissions), or else
>> declares any new ones needed.
>
>
> If this is the new policy I'm fine with 'permissions.py'. But 'Manage
> Site' isn't a good name for a new permission. If we need a new one it
> should be called something like 'Manage action icons'. Or we should
> import the more generic ManagePortal from CMFCore.
Sorry I didn't make myself clear: I don't mind importing it from
CMFCore; I want the module there to make the fact of the import
explicit. Reusing ManagePortal seems like the Right Thing to me, too.
>> This puts the naming of the permissions (but not the string values!)
>> under control of the product author.
>
>
> I can't see why this should be useful. Using different names in CMFCore,
> CMFDefault, CMFCalendar, ... for the same permission just leads to
> confusion.
The same could be said of any "stylistic" difference; the important
thing about the convention is that it makes the author's intention (to
reuse permissions, or not) clear (and therefore debateable ;)
>> While we are at it, why don't we move the ones in CMFCore to a
>> 'permissions.py' module, and leave behind the 'CMFCorePermissions.py'
>> module for backward compatibility.
>
> +0 for the new policy
>
> But if the policy is changed, each CMF package should have its own
> 'permissions.py', not just CMFCore and CMFActionIcons.
+1; that was in fact what I meant to propose. I find the widespread
import ('from Products.CMFCore.CMFCorePermissions import ...') sprinkled
all over creation to be one of our more notable uglinesses.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-CMF
mailing list