Create custom permission in Plone

How To Make Custom Permission [Addons Development]

As a Plone developer we have to deal with several types of permission, for example  `zope2.View`, `cmf.ModifyPortalContent`.  You can also make your own addons specific; you can do it easily from ZMI but I am going show the persistence way  (via zcml)

For example our zcml file name `permissions.zcml`

<configure xmlns="http://namespaces.zope.org/zope">

  <permission id="Your Permission Name as Unique ID"
              title="Your Permission Title ">
    <role name="Role Name"/>
    <role name="Role Name"/>
    ......................
  </permission>
  <permission id="myproduct.addProduct"
              title="My Product Add ">
    <role name="Manager"/>
    <role name="Site Administrator"/>
     ...................... 
   </permission>
</configure>

Activity:

Now add this file in your addon’s configure.zcml

Example:  <include file=”permissions.zcml” />