[Zope] list of naive questions

Chris McDonough chris@iqgroup.com
Sun, 10 Oct 1999 19:45:42 -0400


 Bruce,

 I am by no means a Python or Zope expert, but here goes:

 Why do you want to export a role with your product?  Couldn't you just as
easily allow the product admin to define a role which allows him/her to
provide or deny permissions (defined in the class object) to the product
container or its contained objects on a per-instance basis?  Whenever I've
made a Z Class, I've always allowed it to add permissions to my "Define
Permissions" tab as it sees fit, then I've constructed my own roles within
the instance that make use of those permissions.  Are you defining new
permissions within the class or something?

As far as how to access the container's properties from DTML within a
subobject (I think this is what you're asking), do this... create a dtml
method within the container with this code:

<!--#with "PARENTS[0]"-->
    <!--#var property1-->
    <!--#var property2-->
    etc...
<!--#/with-->

PARENTS[0] is always the container object of the method its called from.
PARENTS[1] is the container object of *that* container object.  PARENTS[2]
is the container object of that container object, and so on.

PARENTS[-1] is the root object.

Similarly, you can get a specific attribute of the containing folder by
doing something like:

<!--#var "PARENTS[0].id"-->


-----Original Message-----
From: bruce@perens.com
To: zope@zope.org
Sent: 10/10/99 7:24 PM
Subject: [Zope] list of naive questions

I have read the ZDG. I'm not a Python or Zope expert. Here are a few
things I haven't figured out:

I have a ZClass Product. I see that I can give some of its DTML
methods proxies using globaly-defined roles. I don't see how to create
Product-specific roles and export them with the product. Thus, I am only
able to set proxies to the roles of "manager", "owner", and "anonymous",
which don't really know anything about my product-specific permissions.
If I create a user folder in the product, it's sort of half-visible in
the
instance - I doubt that's what I want.

How do you call a ZClass factory from DTML, and how do you pass the
container
object? Or do you simply not use the factory and just call the same
things it
calls, from your program?

How does an object access its container? I have an object with
ObjectManager
as one of its base classes. That object contains other objects. The
objects
it contains want to access properties of the container.

	Thanks

	Bruce

_______________________________________________
Zope maillist  -  Zope@zope.org
http://www.zope.org/mailman/listinfo/zope

(Related lists - please, no cross posts or HTML encoding!

To receive general Zope announcements, see:
http://www.zope.org/mailman/listinfo/zope-announce

For developer-specific issues, zope-dev@zope.org -
http://www.zope.org/mailman/listinfo/zope-dev )