[Product-Developers] How to add permissions and create Zope SQL

Andreas Jung lists at zopyx.com
Wed May 13 17:16:04 UTC 2009

On 13.05.09 19:10, cvielma wrote:
> Hi people!
> Well i think my problem it's very stupid, but i have been more than a week
> in it :S
> I want to make a very specialized product, that creates a form view where
> the user put some search criteria and then another view that show the
> results of a table in a relational database that match the criteria. It's
> pretty simple.
> So far, i went through the ZMI and created a database connection (MySQL),
> and the ZSQL Method corresponding to the query. Also, i created the
> standalone views in the product.
> But i'm really stuck in creating a Zope Database Connection and ZSQL Method.
> I followed this:
> http://plone.org/documentation/how-to/add-file-system-zsql-method and
> http://plone.org/documentation/how-to/move-your-zsql-methods-to-the-filesystem. 
> Of course, also checked:
> http://docs.zope.org/zope2/zope2book/source/RelationalDatabases.html.
> Also, i can't create a custom permission to the views (i want that only some
> role or group of users to view the form and query results). I have donde
> this:
> http://plone.org/documentation/how-to/adding-a-custom-permission-to-a-plone-2-5-product

You want to redefine the permissions needed to execute ZSQL methods or
something like
that? That does not make much sense to me. If you need something
different, wrap the original
API calls within your own view. setDefaultRoles() can be used to
introduce new permissions.
Zope 2 permissions must be mapped to a Z3-ish permission within a
permissions.zcml file.
Look at existing code for examples.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20090513/f089545b/attachment.vcf>

More information about the Product-Developers mailing list