On May 20, 12:43 pm, "Alec Thomas" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I think the first phase of the security branch is ready for integration into
> trunk. Some documentation is here:
>
>  http://trac.edgewall.org/wiki/TracDev/SecurityBranch
>

Hi,

I've been reading up on this, and skimmed the code for changes to get
an overview.

I see the general idea obviously, and I see that most methods have
retained the naming and purpose, so I think that looks really good.
Very nice as far as I can see, allthough I haven't tested yet.

However, there is one issue that I cannot quite sort: The
initialisation of the PermissionCache (and similar).

In my 0.10.4 installation, it is initialised like this:
pc = PermissionCache(env, username)

Very easy to use and well functioning for its purpose as a way to
easily map up a user to his/her permissions given a certain context
(env). Fine, makes sense.

In my 0.11dev setup, I see that is has changed to this:
pc = PermissionCache(perms=None)

I haven't done much 0.11 code research yet, but that implementation
seems very thin to me as it essentially requires me to fetch the perms
somehow before-hand, and use that list to initialise the cache?
Without env or context or request information, it has no way of
figuring things out by itself? Nor will it update itself if
permissions change in the cache lifecycle as far as i can see, so I
suppose its only usage is now in a req context that is by definition
very short lived (as req.perms)?

For the security branch the code reads like this:
pc = PermissionCache(env, req, username=None, context=None)

I do quite a lot of plugin writing to support custom and new features
for our hosting operation, and try always to separate my api from the
web_ui to allow flexibility with regards to access (including scripts
and so on). However, the introduction of the 'req' object into
permissions complicates things for me, and I have trouble
understanding the importance of adding request information to a
permission system. If the user has access to a certain entity of
information, surely the access should be granted regardless of how
access is made? I see the same is true for the IPermissionPolicy
interface, and DefaultPermissionPolicy implementation - they also both
require a req object to fetch permissions.

Is there something I am missing to understand this? How can I now
check permissions without a request?


:::simon

[EMAIL PROTECTED]
www.coderesort.com


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