[Zope-dev] LM and user objects

Phillip J. Eby pje@telecommunity.com
Tue, 06 Jun 2000 16:48:16 -0500


At 02:21 PM 6/6/00 -0600, Bill Anderson wrote:
>
>I beleive I have the basic LM concept grasped. I understand that I need
>a 'User' Object, ostensibly can be done in Python or ZClasses. For now,
>I will look at ZClasses for experimentation.
>
>So, I beleive that to set up a ZODB-based User for LM, I need to create
>the UserObject's ZClass. What do I need to subclass, if any, from?

>From Python: Products.LoginManager.LoginUser
>From Zope:   "ZClass_for_LoginUser"


>Once I get that set up, I add property sheets for the user where? The
>ZClass?

To add sheets for the class, do it in the ZClass.  You will then need
AttributeProvider support for the properties (which if you're doing a
Persistent user source, means simply that you leave the default "Persistent
Internal Attribute Provider" active for all attributes).  Alternatively,
you can programmatically add a propertysheet to an individual user at
"runtime", but you will have to create the schema for it at the same time.


>Once I get that set up, how do I add a user? Would one method be to go
>into the acl_users(LM) and add a User? What about adding them
>programmatically? I looled at the API.txt, but it wasn't helpful in this
>regard. :(

I think if you derive your UserSource from the BasicUserSource or
UserSource class in LoginManager, you should be able to simply call the
usersource's newItem(id) method to get a new, empty user object.
Manipulating propertysheets on it will then let you set properties.