On Thu, Jan 11, 2007 at 05:36:01PM +0100, Christian Boos wrote:
> In particular, I'd like to see how we'll convert the attachment module, 
> in a way that would allow generic attachments (see #3068). This 
> shouldn't require any additional interface (i.e. /not/ the 
> IAttachmentPointProvider way) but should result from the ability to add 
> attachment to any kind of resource (this doesn't mean we'll add an UI to 
> do this for every kind of resource!).

After contemplating this for a while, I think the most elegant solution
is to add an _ATTACH permission. This makes more sense anyway, IMO, as
attaching something to an object is distinct from MODIFYing it.

So there could then be WIKI_ATTACH, TICKET_ATTACH, MILESTONE_ATTACH,
etc.

----------- Future rant -------------

Once the permissions are more uniform, we can begin removing the
reliance on having a permission for each action on each object and move
to a small set of permissions:

    VIEW
    CREATE
    DELETE
    MODIFY
    APPEND
    ATTACH
    GRANT (maybe? for allowing a user to grant other users non-ADMIN 
permissions)
    ADMIN (all of the above)

Here's a patch: http://swapoff.org/files/new-permissions.diff. This
converts the wiki module to the new permission system, but also adds a
LegacyPermission component for backwards compatibility, which simply
maps all the new style permissions with `realm.upper() + '_' perm`.

The only slight "wart" is that the module itself defines the
permissions, even of things like ATTACH which perhaps should be defined
in other modules, but perhaps not. I think this is difficult to avoid
though, because the attachment module and its parent are co-reliant.

-- 
Evolution: Taking care of those too stupid to take care of themselves.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to