Create custom permissions in your Morpheus Plugin

Hi all,

I was recently helping a customer who was trying to create a custom permission in their plugin with the intention that this permission be visible in the UI when creating a new role under Administration > Roles.

I have created a working implementation of how to add custom permissions via the Plugin API (I wrote something quite groovy):

Note:
The new permission shows up under the ‘Uncategorized Permissions’ section when you create a new role (or view an existing one) in the UI. It looks like it is possible to specify a subcategory but I still need to test if/how this works.

Enjoy!

1 Like

:watermelon:

1 Like

Hii,

I was experimenting this other day. I see that the newly created custom permission doesn’t get removed once the plugin is disabled or deleted. Can the deletion of that permission be achieved once plugin is removed?

Additionally, I came across this issue while trying out:


No logs were generated.

Implementation of the onDestroy() method should handle gracefully disabling + removing the permission. If this isn’t happening, can you please raise a support case (via the support portal) and attach a link to your plugin code so that I can look into this further?