Search in sources :

Example 1 with PermissionTemplateCharacteristicDao

use of org.sonar.db.permission.template.PermissionTemplateCharacteristicDao in project sonarqube by SonarSource.

the class RemoveProjectCreatorFromTemplateAction method doHandle.

private void doHandle(RemoveProjectCreatorFromTemplateWsRequest request) {
    try (DbSession dbSession = dbClient.openSession(false)) {
        PermissionTemplateDto template = wsSupport.findTemplate(dbSession, WsTemplateRef.newTemplateRef(request.getTemplateId(), request.getOrganization(), request.getTemplateName()));
        checkGlobalAdmin(userSession, template.getOrganizationUuid());
        PermissionTemplateCharacteristicDao dao = dbClient.permissionTemplateCharacteristicDao();
        dao.selectByPermissionAndTemplateId(dbSession, request.getPermission(), template.getId()).ifPresent(permissionTemplateCharacteristicDto -> updateTemplateCharacteristic(dbSession, permissionTemplateCharacteristicDto));
    }
}
Also used : DbSession(org.sonar.db.DbSession) PermissionTemplateDto(org.sonar.db.permission.template.PermissionTemplateDto) PermissionTemplateCharacteristicDao(org.sonar.db.permission.template.PermissionTemplateCharacteristicDao)

Aggregations

DbSession (org.sonar.db.DbSession)1 PermissionTemplateCharacteristicDao (org.sonar.db.permission.template.PermissionTemplateCharacteristicDao)1 PermissionTemplateDto (org.sonar.db.permission.template.PermissionTemplateDto)1