Using plone.api.user.has_permission

Hi,
In the Docs it is not clear what should be the Value of Parameter "Permission"

If i define a permission via Generic Setup like so:

<!--  permission.zcml-->
<configure
    xmlns="http://namespaces.zope.org/zope"
    i18n_domain="my.addon">    

    <permission
        id="my.addon.ViewGroupInfoViewlet"
        title="my.addon: View GroupInfo Viewlet" />        

</configure>

Should i use the ID or the Title for the Parameter in the api method?

Hi Jan,

That would be the title of the permission, the Zope2 permission name. ie 'View' not 'zope2.View'.
See also https://docs.plone.org/develop/plone.api/docs/user.html#check-user-permission

Have fun!
-Roel

Title


https://docs.plone.org/develop/plone.api/docs/user.html#check-user-permission
and - https://docs.plone.org/develop/plone/security/permission_lists.html#id1

Thnx!

Could someone be so kind as to make a pull request to say this in the docs...? :slight_smile: