Search in sources :

Example 1 with MyPermissionsService

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();
}
Also used : JiraCloudServiceFactory(com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory) PermissionModel(com.synopsys.integration.jira.common.model.response.PermissionModel) MultiPermissionResponseModel(com.synopsys.integration.jira.common.model.response.MultiPermissionResponseModel) JiraCloudProperties(com.synopsys.integration.alert.channel.jira.cloud.JiraCloudProperties) MyPermissionsService(com.synopsys.integration.jira.common.cloud.service.MyPermissionsService)

Aggregations

JiraCloudProperties (com.synopsys.integration.alert.channel.jira.cloud.JiraCloudProperties)1 JiraCloudServiceFactory (com.synopsys.integration.jira.common.cloud.service.JiraCloudServiceFactory)1 MyPermissionsService (com.synopsys.integration.jira.common.cloud.service.MyPermissionsService)1 MultiPermissionResponseModel (com.synopsys.integration.jira.common.model.response.MultiPermissionResponseModel)1 PermissionModel (com.synopsys.integration.jira.common.model.response.PermissionModel)1