[Zope] zope and forms

Alexis Roda arv@si.urv.es
Tue, 15 Oct 2002 12:15:41 +0200


Oliver Bleutgen wrote:
> 
> > How can I create a new role from a python script?
> 
> Hmm, interesting, this method is private.... (_addRole)
> 
> Maybe something like
> 
> f = folder.where.to.add.the.role
> RoleName = 'my_new_rolename'
> f.manage_defined_roles(submit='Add Role',REQUEST={'roles',RoleName})

This does not work for me. I'm still learning zope, so surelly I'm doing
something wrong. Anyway, I'll try to explain why I need to create roles
dinamically, hope some zope guru can give me a better approach.

I should develop a web application to help on the management of
documents, but all "complex" zope details should be hidden under a
simple user interface.

In short, we have events (congress, meeting etc.) and every event
can have areas of knowledge (marketing, e-commerce, accounting etc.).
The actual areas for an event will depend on the event topic.

A document_manager creates events, reviewers and optionally areas
and assigns reviewers to each area. Anonymous users can upload papers
to any (event, area).

A reviewer can only access documents in the (event, area) tuples it
is assigned to. But it may be assigned to different (event, area).
Additionally a reviewer is an authenticated user, so it may have
other roles outside the document management area (btw. it can access
already published documents)

The security schema I'm considering is based on dynamically created
roles:

* create an acl_users folder on top of the site containing all the
  users
* when the document_manager creates events and areas create roles
  dinaymically (lets say manage_ev1_ar1, review_ev1_ar1 etc.)
  Those roles should be created on the top of the site so they
  can be assigned to the selected users
* programatically set permision on events/ev?/ar? folder so that only
  users with review_ev?_ar? role can access them, manage_ev?_ar? can
  manage them etc.
* once the event has finished revoke the relevant roles from all
  users, delete the roles and publish the accepted papers.

This schema fits with the problem but it seems to me a bit
overcomplicated. It would be nice to hear the opinion from
more expecienced zope users.


TIA
Regards
-- 
                                  ////
                                 (@ @)
---------------------------oOO----(_)----OOo------------------------
        Los pecados de los tres mundos desapareceran conmigo.
Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
--------------------------------------------------------------------