use of com.synopsys.integration.jira.common.cloud.service.MyPermissionsService in project hub-alert by blackducksoftware.
the class JiraCloudGlobalFieldModelTestAction method isUserAdmin.
@Override
protected boolean isUserAdmin(FieldUtility fieldUtility) throws IntegrationException {
JiraCloudProperties jiraProperties = jiraCloudPropertiesFactory.createJiraProperties(fieldUtility);
JiraCloudServiceFactory jiraCloudServiceFactory = jiraProperties.createJiraServicesCloudFactory(logger, gson);
MyPermissionsService myPermissionsService = jiraCloudServiceFactory.createMyPermissionsService();
MultiPermissionResponseModel myPermissions = myPermissionsService.getMyPermissions(JiraGlobalFieldModelTestAction.JIRA_ADMIN_PERMISSION_NAME);
PermissionModel adminPermission = myPermissions.extractPermission(JiraGlobalFieldModelTestAction.JIRA_ADMIN_PERMISSION_NAME);
return null != adminPermission && adminPermission.getHavePermission();
}
Aggregations