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));
}
}
Aggregations