Hi all, I have a couple of questions: A form contains a <input name="foo:int">. If I leave the input empty, when I submit the form zope complains about "integer value expected". Ok, the empty string is not a valid integer value, but sometimes it is right to leave an input field blank. Is there a way to take ride of this or should I use string values and check the received values in then method/script? Is it possible to make zope accept dates entered into <input name="foo:date"> formated acording to DD/MM/YYYY? How can I create a new role from a python script? TIA Regards -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
Alexis Roda wrote:
Hi all, I have a couple of questions:
A form contains a <input name="foo:int">. If I leave the input empty, when I submit the form zope complains about "integer value expected". Ok, the empty string is not a valid integer value, but sometimes it is right to leave an input field blank. Is there a way to take ride of this or should I use string values and check the received values in then method/script?
Is it possible to make zope accept dates entered into <input name="foo:date"> formated acording to DD/MM/YYYY?
See http://www.zope.org/Members/Zen/howto/FormVariableTypes
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}) HTH, oliver
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) --------------------------------------------------------------------
On Tuesday 15 Oct 2002 11:15 am, Alexis Roda wrote:
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.
Have you considered creating a fixed set of top level roles, and assigning them as 'local roles' to appropriate users, at the appropriate level?
participants (3)
-
Alexis Roda -
Oliver Bleutgen -
Toby Dickenson