How can I check Assets permissions(scheme, object type) by groovy script?

Aleksandr Derugo
Contributor
July 19, 2024

Hi, I would like to set up a validator in the issue workflow. Maybe someone knows how to check user permissions to create/edit an Assets object by groovy script? I couldn`t find any methods in the HAPI or Assets plugin API.

1 answer

1 accepted

5 votes
Answer accepted
Aleksandr Derugo
Contributor
July 19, 2024

I was wrong :) Assets Plugin API has a class InsightPermissionFacadeImpl and this class contains method hasInsightPermission(com.atlassian.jira.user.ApplicationUser user, int permission, Integer id).
Maybe this information will be helpful to someone because I spent time to understand what it is :)
"int permission" is permission type from db table AO_8542F1_IFJ_ROLE
"Integer id" is schema/object type id

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events