Permissions for dexterity content

I have created a dexterity content in plone.

http://pastebin.com/s1Ct8QWs

1)I could see the permission(ex.my.MyType) listed in security tab of ZMI.
But when I login as myuser I could not see the Add New tab to add the content (mypage).

2)Now in portal_types/mypage in ZMI,
Add permission I set to ex.my.MyType
After this change, I am able to see the Add New tab and my content (mypage).
But when I click mypage, I get Insufficient privileges

Please advice

I think the issue is that your custom role doesn't have all the required permissions for creating content.

If you assign your custom permission to default Plone roles (see [1]):

<?xml version="1.0"?>
<rolemap>
  <permissions>
    <permission name="ex: Add My Type" acquire="True">
      <role name="Manager"/>
      <role name="Site Administrator"/>
      <role name="Owner"/>
      <role name="Contributor"/>
    </permission>
  </permissions>
</rolemap>

Then it should be possible to add a new object as a Contributor, Site Administrator etc., since those roles also have other required permissions.

As per [2] you need to have these permissions to create content inside a folder:

In the parent folder:

  • View
  • Add portal content
  • Access content information
  • Create XXX (in your case "ex: Add My Type" )

On the object:

  • View
  • Modify portal content
  • Access content information

So if you want to use your custom role you need to assign these additional permissions to it through rolemap.xml (see default Plone rolemap.xml [3]) and/or workflows.

[1] http://docs.plone.org/develop/plone/security/custom_permissions.html
[2] http://play.pixelblaster.ro/blog/archive/2006/08/27/allowing-the-anonymous-to-add-portal-content
[3] https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/profiles/default/rolemap.xml