users, properties and roles
I am writing a zope2 workflow product. There are a variety of roles in the flow: a researcher, administrator, reviewer. I am in the very early stages of implementing the product and am wondering how to best reuse zope's users and rolls. For example, I would like to have extra properties on my users, say an email address, contact phone etc. Is it good practice to subclass AccessControl.User.BasicUser and BasicUserFolder to add properties to the user? Is it good practice to add the additional roles (researcher, reviewer) within the standard manage_access framework? In out project, these roles can overlap (you can be a researcher and a reviewer on different projects in the same workflow) and do determine access level information. I've looked over the User Management products at zope.org. Does one or more of these come recommended to support, for example, easy addition of user properties as described above? Thanks for any and all advice! John Hunter Zope-2.7
Hey John, I wrote something that tracked new roles, eg 'accountant', 'management', etc and other information about users. I found that using simpleUserFolder and hooking it up to an external DB (interbase) gave me everything I needed - plus easier portibility. David ps if you decide to test out simpleUserFolder DO NOT test it in zope/root but in a test subdirectory - otherwise you might lock yourself out of Zope. ----- Original Message ----- From: "John Hunter" <jdhunter@ace.bsd.uchicago.edu> To: "Zope Users" <zope@zope.org> Sent: Tuesday, June 15, 2004 1:46 PM Subject: [Zope] users, properties and roles
I am writing a zope2 workflow product. There are a variety of roles in the flow: a researcher, administrator, reviewer. I am in the very early stages of implementing the product and am wondering how to best reuse zope's users and rolls.
For example, I would like to have extra properties on my users, say an email address, contact phone etc. Is it good practice to subclass AccessControl.User.BasicUser and BasicUserFolder to add properties to the user?
Is it good practice to add the additional roles (researcher, reviewer) within the standard manage_access framework? In out project, these roles can overlap (you can be a researcher and a reviewer on different projects in the same workflow) and do determine access level information.
I've looked over the User Management products at zope.org. Does one or more of these come recommended to support, for example, easy addition of user properties as described above?
Thanks for any and all advice! John Hunter
Zope-2.7
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
"David" == David Hassalevris <bluepaul@earthlink.net> writes:
David> Hey John, I wrote something that tracked new roles, eg David> 'accountant', 'management', etc and other information about David> users. I found that using simpleUserFolder and hooking it David> up to an external DB (interbase) gave me everything I David> needed - plus easier portibility. David ps if you decide David> to test out simpleUserFolder DO NOT test it in zope/root David> but in a test subdirectory - otherwise you might lock David> yourself out of Zope. OK, that seems like a great compromise. My plan to have a Users Folder along side my SimpleUsers acl_users folder, and add User subfolders in the Users folder which contain my user meta information. I'm a bit rusty on the zope API. I'm overriding addUser in the SimpleUserFolder def addUser(self, name, password, roles, domains, **kw): pass What is the zope magic that would allow me to create a folder named "name" in Users where Users is a plain vanilla folder in the same container that the SimpleUserFolder is located in? I know I need something like container.manage_addFolder(name) but I don't know how to get the container in the zope API? Thanks! JDH
On Wednesday 16 June 2004 02:02 pm, John Hunter wrote:
I'm a bit rusty on the zope API. I'm overriding addUser in the SimpleUserFolder
def addUser(self, name, password, roles, domains, **kw): pass
What is the zope magic that would allow me to create a folder named "name" in Users where Users is a plain vanilla folder in the same container that the SimpleUserFolder is located in?
I know I need something like
container.manage_addFolder(name)
but I don't know how to get the container in the zope API?
I know this is going to come as a shocker, but it's called "container". :-D Seriously, if you want the folder in which a Python Script is located, you want "container". If you want the folder in whose context the script was called (i.e. by acquisition), then you want "context". So, in fact you just wrote what you need -- try it as is. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
"Terry" == Terry Hancock <hancock@anansispaceworks.com> writes:
Terry> I know this is going to come as a shocker, but it's called Terry> "container". :-D Terry> Seriously, if you want the folder in which a Python Script Terry> is located, you want "container". If you want the folder Terry> in whose context the script was called (i.e. by Terry> acquisition), then you want "context". Terry> So, in fact you just wrote what you need -- try it as is. Sorry I wasn't being clear. I am not using a python script, but writing python in my Products folder. In this space, the magic container and context are not available AFIK, so I was using them by analagy. I believe what I am looking for is self.aq_parent Thanks! JDH
participants (3)
-
David Hassalevris -
John Hunter -
Terry Hancock