Re: [Zope] Local Roles and Acquisition
Thanks, Dylan. Ultimately I decided to modify getRolesInContext(). It seemed like the easiest fix and will allow much more flexibility in the long run in creating new roles and users. From a design perspective, it doesn't seem clean or efficient to engineer around Zope's standard operating procedures. Why not change them instead? In short, my new getRolesInContext() executes in the normal fashion, except when passed an object with my classes' meta_types. In this case, it checks local roles explicitly assigned to the object and its parent only, then returns only the local roles shared by both object and parent. Now I have a much more file-system-like level of security management. Yeah! Dylan Reinhardt <zope@dylanreinha To: nwingfield@che-llp.com rdt.com> cc: Zope Users <zope@zope.org> Subject: Re: [Zope] Local Roles and Acquisition 09/09/2003 02:05 PM Please respond to zope On Tue, 2003-09-09 at 09:47, nwingfield@che-llp.com wrote:
I spoke of 'Viewer' and 'Editor' (actually I'm recycling 'Owner') roles. On my root folder, these are loosely mapped to the 'View' and 'Edit' privileges, respectively. Almost all of my methods are restricted to one of these two privileges using declareProtected().
OK.
The problem comes in when Zope combines the explicit local roles with any local roles granted on all parent objects, effectively granting a user more roles than it ought.
I'm not sure that's the only problem. It's easy enough to restrict acquisition of permissions. I think a bigger problem may be that you are defining roles coarsely. With only one editor role, it's going to be difficult to distinguish between "editor in one context" and "editor in another context". At a minimum, this sounds like a three-role system: - Viewer - Owner (default Editor) - Guest Editor If I understand you, everyone can view and owners can edit. On certain objects, you want to enable "guest" (non-owner) editing. To do this, create the GuestEdit role at the highest level it should apply and add it to the correct users' roles. If you want your guest editor list to be same for all objects that enable guest editing, you're pretty much done: just enable guest editing per object desired. On the other hand, if you want to define *who* has the guest edit role per object, that's going to be a lot more work. The standard way to do that would be to create a role for each desired permutation. :-) Depending on how many users and objects we're talking about, it may be worth thinking about creating a root-level method that has an Editor proxy role. This method could have one large mapping containing each object each user should be able to guest edit (or vice versa). Basic object permissions for inner objects are configured strictly and this method allows users to "pierce" the security for objects they should have greater access to. This solution isn't necessarily easy or foolproof, but might be worth considering if you're talking about a really large system with many different combinations of editors and objects. HTH, Dylan
From a design perspective, it doesn't seem clean or efficient to engineer around Zope's standard operating procedures. Why not change them instead?
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain. jens
Jens Vagelpohl wrote at 2003-9-10 09:42 -0400:
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain.
Unless, you manage Zope in CVS... Dieter
On Wednesday, Sep 10, 2003, at 16:03 US/Eastern, Dieter Maurer wrote:
Jens Vagelpohl wrote at 2003-9-10 09:42 -0400:
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain.
Unless, you manage Zope in CVS...
Dieter
Absolutely correct, but I daresay only the smallest minority actually does that ;) jens
Jens Vagelpohl wrote at 2003-9-10 17:20 -0400:
On Wednesday, Sep 10, 2003, at 16:03 US/Eastern, Dieter Maurer wrote:
Jens Vagelpohl wrote at 2003-9-10 09:42 -0400:
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain.
Unless, you manage Zope in CVS...
Dieter
Absolutely correct, but I daresay only the smallest minority actually does that ;)
You are absolutely right. But for anyone who plans to modify core Zope code this is an option to keep maintainability quite easy. He may also be interested in a CVS patch I submitted to "bugs-cvs@gnu.org" which lets the "-kk" CVS option work correctly for binary files. "-kk" is essential to get rid of conflicts caused by "$Id:$ (or other CVS keyword) strings. As I understand it, the CVS authors plan to include this patch in future CVS releases. Dieter
Jens Vagelpohl wrote:
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain.
This is not universally true (probably is in this instance but ...). Maintaining modifications to the zope core is actually astonishingly simple if one knows how to use CVS and vendor branches. I maintain a personal fork that way, and its a breeze. -- Jamie Heilman http://audible.transient.net/~jamie/
Jens Vagelpohl wrote:
You just created a maintenance nightmare, that's why. Rewriting the core Zope software instead of e.g. creating a filesystem product that contains your changes will make every attempted Zope upgrade a pain.
This is not universally true (probably is in this instance but ...). Maintaining modifications to the zope core is actually astonishingly simple if one knows how to use CVS and vendor branches. I maintain a personal fork that way, and its a breeze.
Yeah, just like I said to Dieter, that's correct and an easy way to do it. For the 10 people who do it :) jens
participants (4)
-
Dieter Maurer -
Jamie Heilman -
Jens Vagelpohl -
nwingfield@che-llp.com