Search in sources :

Example 1 with MyPermissionsService

use of com.synopsys.integration.jira.common.server.service.MyPermissionsService in project hub-alert by blackducksoftware.

the class JiraServerGlobalFieldModelTestAction method isUserAdmin.

@Override
protected boolean isUserAdmin(FieldUtility fieldUtility) throws IntegrationException {
    JiraServerProperties jiraProperties = createJiraProperties(fieldUtility);
    JiraServerServiceFactory jiraServerServiceFactory = jiraProperties.createJiraServicesServerFactory(logger, gson);
    MyPermissionsService myPermissionsService = jiraServerServiceFactory.createMyPermissionsService();
    MultiPermissionResponseModel myPermissions = myPermissionsService.getMyPermissions();
    PermissionModel adminPermission = myPermissions.extractPermission(JiraGlobalFieldModelTestAction.JIRA_ADMIN_PERMISSION_NAME);
    return null != adminPermission && adminPermission.getHavePermission();
}
Also used : JiraServerServiceFactory(com.synopsys.integration.jira.common.server.service.JiraServerServiceFactory) PermissionModel(com.synopsys.integration.jira.common.model.response.PermissionModel) MultiPermissionResponseModel(com.synopsys.integration.jira.common.model.response.MultiPermissionResponseModel) JiraServerProperties(com.synopsys.integration.alert.channel.jira.server.JiraServerProperties) MyPermissionsService(com.synopsys.integration.jira.common.server.service.MyPermissionsService)

Example 2 with MyPermissionsService

use of com.synopsys.integration.jira.common.server.service.MyPermissionsService in project hub-alert by blackducksoftware.

the class JiraServerGlobalTestActionWrapper method isUserAdmin.

public boolean isUserAdmin() throws IntegrationException {
    MyPermissionsService myPermissionsService = jiraServerServiceFactory.createMyPermissionsService();
    MultiPermissionResponseModel myPermissions = myPermissionsService.getMyPermissions();
    PermissionModel adminPermission = myPermissions.extractPermission(JiraServerGlobalTestAction.JIRA_ADMIN_PERMISSION_NAME);
    return null != adminPermission && adminPermission.getHavePermission();
}
Also used : PermissionModel(com.synopsys.integration.jira.common.model.response.PermissionModel) MultiPermissionResponseModel(com.synopsys.integration.jira.common.model.response.MultiPermissionResponseModel) MyPermissionsService(com.synopsys.integration.jira.common.server.service.MyPermissionsService)

Aggregations

MultiPermissionResponseModel (com.synopsys.integration.jira.common.model.response.MultiPermissionResponseModel)2 PermissionModel (com.synopsys.integration.jira.common.model.response.PermissionModel)2 MyPermissionsService (com.synopsys.integration.jira.common.server.service.MyPermissionsService)2 JiraServerProperties (com.synopsys.integration.alert.channel.jira.server.JiraServerProperties)1 JiraServerServiceFactory (com.synopsys.integration.jira.common.server.service.JiraServerServiceFactory)1