Felix Schwarz wrote:
> Hi,
>
> after playing around with IPermissionPolicy for some time I suspect 
> that some use case are not really handled well by the current API and 
> I would like to resolve that for 0.12 :-)
>
> 1. For every policy check I have to load the db object again even if
>    the caller has a db object already. Can we make it
>    resource_or_dbobject?

Hm no, that will break the existing API.
But we can think about alternatives. For example, having a thread local 
cache for model objects which could make the retrieval of an already 
instantiated object from its resource cheap. Other ideas welcomed.

> 2. Say I want to create a policy that prevents users to file tickets
>    with a specific milestone (this needs triage). How to do that in a
>    permission policy? 

I don't think a permission policy is adequate here, at least not in the 
current model where we don't check permissions on the milestone when 
creating a ticket. So maybe the ticket validation approach would be more 
adequate here (see ITicketManipulator).

-- Christian

--~--~---------~--~----~------------~-------~--~----~
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