How to delete a custom permission/role created through microservice

Product/components used and version/fix level:

Cumulocity Production

Detailed explanation of the problem:

Hi, I wanted to know how to create custom permissions and @Tristan_Bastian helped us and gave us a custom logic How to access custom global role in service - #7 by Tristan_Bastian here. I tried to do the same and it worked but now I am not able to delete that custom permission. I tried to delete the custom microservice thinking it would delete the perms as well but that didn’t happen. Can anyone please guide me how I can delete the custom perm/role.

Thanks,
Samanyu

Hi Samanyu,

unfortunately, there isn’t any exposed API, which allows you to manage custom permissions. Creating custom permissions via a Microservice is currently just a workaround, but you can’t delete these custom permissions afterwards yourself. It’s currently a limitation of Cumulocity.

I suggest to create a support ticket and have Operations look at it. They might be able to delete them using direct access to the database.

Best regards



Christian Guether

1 Like

Okay, Thank you, Christian.

At newer versions…

When unsubscribing the Microservice, the permissions would be removed automatically. However, if there is another microservice with the same permissions or if there is a group or user that has the permissions assigned, the permissions will not be removed.

If you still have the microservice, you could try to re-subscribe it, remove the permissions from any users/groups, then unsubscribe it again.

2 Likes