On Zope and Plone you can register permissions like this:
<permission
id="choosen.id.for.your.permission"
title="Old Zope 2 permission, shown in ZMI"
/>
What is the way to get the permission's title from Python when you know the permission's id?
I mean something like:
>>> something_magic.get('choosen.id.for.your.permission')
'Old Zope 2 permission, shown in ZMI'
Permissions are registered as
zope.security.interfaces.IPermission
utilities by their id; you can thus look them up by their ids by usingzope.component.getUtility()
:To go the other way, from title to id, you need to search all utilities: