O'Reilly logo

Plone 3 Products Development Cookbook by Marcos F. Romero, Juan Pablo Giménez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Protecting operations with permissions

The whole point of creating permissions and roles in a Plone site is, at the end of the day, to add security restrictions to certain methods, operations, or information within the portal.

Although we've been doing this in previous chapters, we'll now pinpoint how to do it.

How to do it...

  1. Control who can create objects of a certain class: Modify the configure.zcml file in the pox.banner package by changing the cmf.AddPortalContent permission with pox.ManageBanners.
    <configure ... >
    ...
    <permission
    id="pox.ManageBanners"
    title="Manage banners and sections"
    />
    ...
    <five:registerClass
    class=".content.section.Section"
    meta_type="Section"
    permission="pox.ManageBanners" />
    
    ...
    </configure>
    
    • With this change, we allow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required