Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7df81f4
Extract transactional native category asset relocation
jeckodevelopment Dec 5, 2026
7eb9618
Reuse atomic ACL subtree move for pathway authoring
jeckodevelopment Dec 5, 2026
f1bf52b
Move category records and native ACL subtrees atomically with current…
jeckodevelopment Dec 5, 2026
45a205f
Test category ACL inheritance and atomic rollback on collision
jeckodevelopment Dec 5, 2026
703ada9
Exercise denied lifecycle transitions and unchanged historical ACL sn…
jeckodevelopment Dec 5, 2026
e030bcb
Recheck privacy retention under identity locks and timestamp subject …
jeckodevelopment Dec 5, 2026
d702665
test: verify native privacy removal of an enrolled identity
jeckodevelopment Dec 5, 2026
8990efa
test: keep destination create permission in record-deny regression
jeckodevelopment Dec 5, 2026
a9aae42
docs: reconcile lifecycle and privacy candidate evidence without prem…
jeckodevelopment Dec 5, 2026
dc89c02
docs: reconcile lifecycle and privacy candidate evidence without prem…
jeckodevelopment Dec 5, 2026
6ee8b3d
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
cecbc9b
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
b409a4a
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
042322c
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
b108734
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
7e29a19
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
0cc251e
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
20ccd4b
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
98974fc
docs: record LIFE closeout candidate and align development version
jeckodevelopment Dec 5, 2026
a180988
docs: link PR 1269 in canonical requirements matrix
jeckodevelopment Dec 5, 2026
86c0af5
docs: verify privacy retention blocks are atomic in manual acceptance
jeckodevelopment Dec 5, 2026
c29d5da
style: format direct lifecycle transition test arguments PSR-12
jeckodevelopment Dec 5, 2026
baa20d9
docs: align DOC-04 to development version 0.70.13
jeckodevelopment Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**JD Learn 0.70.13-dev — LIFE-02/03/09 (PR #1269):** candidata con ricollocazione atomica delle categorie e degli asset ACL Joomla, revisione editoriale aggiornata, rollback su collisione, verifiche sulle transizioni dirette e dissociazione privacy con ricontrollo della conservazione e timestamp. Nessuna promozione dei criteri non ancora integralmente attestati; collaudo Joomla e politica di conservazione del sito separati.

**JD Learn 0.70.12-dev — LES-02/03/04 (PR #1268):** chiusura software con filtro dei parametri sensibili e attributi HTML robusto, coerenza del formato con la modalità storage e regressioni su consegna managed, riconfigurazione, limite upload MP4 e conservazione della sorgente. Nessuna promozione dei quattro criteri operativi non verificabili; collaudo Joomla e hosting/CDN reale separati.

**JD Learn 0.70.11-dev — EDGE-12/13/14:** candidata conclusiva PR #1267, 9/9 + 7/7 + 6/6 criteri software. Protezione video senza fallback, validazione dei grant Stream, identità Joomla non trasferibile, diagnostica dei riferimenti nativi e conservazione di storico, documenti, ACL, template mail e override in upgrade. Minimo documentato candidato 73.83%; verifica CI e collaudo Joomla distinti.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JD Learn

**Versione sorgente corrente:** `0.70.12-dev`. Il changelog registra le modifiche della versione; questo riepilogo non sostituisce le evidenze dell'audit funzionale.
**Versione sorgente corrente:** `0.70.13-dev`. Il changelog registra le modifiche della versione; questo riepilogo non sostituisce le evidenze dell'audit funzionale.

**Stato sviluppo documentato (5/12/2026):** la ricognizione copre 214 requisiti e 763 criteri della baseline 1.0.0: **588 implementati, 5 lacune accertate e 170 non verificabili**. Il minimo di evidenze di sviluppo è **73,83%**; la percentuale funzionale globale resta non calcolabile finché persistono criteri non verificabili. L'accettazione Joomla è distinta: 10 requisiti avviati, 204 non eseguiti e nessuno completato. Lo stato aggiornato delle evidenze è in [Release Dashboard](docs/RELEASE_DASHBOARD.md), [audit](docs/FUNCTIONAL_AUDIT_CURRENT.md) e [matrice](docs/REQUIREMENTS_STATUS.csv). La versione `-dev` non è una release stabile e la distribuzione deve riferirsi all'artefatto e checksum effettivi della medesima CI.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Jlms\Component\Jlms\Administrator\Application;

use Jlms\Component\Jlms\Administrator\Infrastructure\CategoryAssetRelocation;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\Finder\AfterSaveEvent;
use Joomla\CMS\Factory;
Expand Down Expand Up @@ -112,6 +113,7 @@ public function inspect(User $actor, int $categoryId): array
static function (object $target) use ($actor, $reference): bool {
$asset = $reference['extension'] . '.category.' . (int) $target->id;
return (empty($target->checked_out) || (int) $target->checked_out === (int) $actor->id)
&& $actor->authorise('core.create', $asset)
&& ($actor->authorise('core.edit', $asset)
|| ((int) $target->created_user_id === (int) $actor->id && $actor
->authorise('core.edit.own', $asset)));
Expand Down Expand Up @@ -173,6 +175,7 @@ public function reassign(User $actor, int $categoryId, array $destinations, stri
throw new \InvalidArgumentException('COM_JLMS_CATEGORY_REASSIGN_INVALID_TARGET');
}
$this->assertManage($actor, $destination, 'core.edit');
$this->assertManage($actor, $destination, 'core.create');
$resolved[$key] = [
'table' => $reference['table'],
'extension' => $reference['extension'],
Expand All @@ -192,11 +195,35 @@ public function reassign(User $actor, int $categoryId, array $destinations, stri
$courseIds = [];
$this->db->transactionStart();
try {
// Serialize with native authoring transactions, then lock the
// category section before refreshing the review and destinations.
$this->db->setQuery("SELECT id FROM #__assets WHERE name='com_jlms' FOR UPDATE")->loadResult()
?: throw new \RuntimeException('JERROR_ALERTNOAUTHOR', 403);
$section = (string) $source->extension;
$categoryLock = $this->db->createQuery()->select('id')->from('#__categories')
->where('extension = :extension')->order('id')
->bind(':extension', $section);
$categoryLock->setQuery((string) $categoryLock . ' FOR UPDATE');
$this->db->setQuery($categoryLock)->loadColumn();
$current = $this->inspect($actor, $categoryId);
if (!hash_equals($current['review_token'], $reviewToken)) {
throw new \RuntimeException('COM_JLMS_CATEGORY_REASSIGN_STALE', 409);
}
foreach ($resolved as $key => $item) {
$destination = $this->category($item['target']);
if (
$destination->extension !== $item['extension']
|| ((int) $destination->lft > (int) $current['category']->lft
&& (int) $destination->rgt < (int) $current['category']->rgt)
) {
throw new \InvalidArgumentException('COM_JLMS_CATEGORY_REASSIGN_INVALID_TARGET');
}
$this->assertManage($actor, $destination, 'core.edit');
$this->assertManage($actor, $destination, 'core.create');
// Lock and validate *every* affected record, not only the source/destination
// category. Explicit record ACL denies and another editor's checkout win.
$rowsQuery = $this->db->createQuery()
->select('id, created_by, checked_out')
->select('id, asset_id, created_by, checked_out')
->from($this->db->quoteName($item['table']))
->where('catid = :source')
->order('id ASC')
Expand All @@ -219,17 +246,33 @@ public function reassign(User $actor, int $categoryId, array $destinations, stri
throw new \RuntimeException('JERROR_ALERTNOAUTHOR', 403);
}
}
foreach ($rows as $row) {
CategoryAssetRelocation::move(
$this->db,
(int) $row->asset_id,
$item['extension'] . '.' . (int) $row->id,
(int) $destination->asset_id,
$item['extension'] . '.category.' . (int) $destination->id
);
}
if ($key === 'courses') {
$courseIds = $lockedIds;
}
$query = $this->db->createQuery()
->update($this->db->quoteName($item['table']))
->set($this->db->quoteName('catid') . ' = :target')
->set('revision = revision + 1')
->set('modified_by = :actor')
->set('modified_at = :modified')
->where($this->db->quoteName('catid') . ' = :source');
$targetId = $item['target'];
$sourceId = $categoryId;
$actorId = (int) $actor->id;
$modified = gmdate('Y-m-d H:i:s');
$query->bind(':target', $targetId, ParameterType::INTEGER)
->bind(':source', $sourceId, ParameterType::INTEGER);
->bind(':source', $sourceId, ParameterType::INTEGER)
->bind(':actor', $actorId, ParameterType::INTEGER)
->bind(':modified', $modified);
$this->db->setQuery($query)->execute();
if ($this->db->getAffectedRows() !== $item['expected']) {
throw new \RuntimeException('COM_JLMS_CATEGORY_REASSIGN_STALE');
Expand All @@ -241,6 +284,9 @@ public function reassign(User $actor, int $categoryId, array $destinations, stri
throw $error;
}

// A subsequent authorization check must see the new native asset ancestry.
\Joomla\CMS\Access\Access::clearStatics();
$actor->clearAccessRights();
if (isset($resolved['courses']) && ComponentHelper::isEnabled('com_finder')) {
$this->reindexCourses($courseIds);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

declare(strict_types=1);

namespace Jlms\Component\Jlms\Administrator\Infrastructure;

use Joomla\Database\DatabaseInterface;
use Joomla\Database\ParameterType;

/** Move an existing native ACL subtree within the caller's authoring transaction. */
final class CategoryAssetRelocation
{
public static function move(
DatabaseInterface $db,
int $assetId,
string $sourceName,
int $targetAssetId,
string $targetName
): void {
$query = $db->createQuery()->select('id, name, parent_id, lft, rgt, level')
->from('#__assets')->where('id IN (:asset, :target)')
->bind(':asset', $assetId, ParameterType::INTEGER)
->bind(':target', $targetAssetId, ParameterType::INTEGER);
$query->setQuery((string) $query . ' FOR UPDATE');
$rows = $db->setQuery($query)->loadObjectList('id');
$source = $rows[$assetId] ?? null;
$target = $rows[$targetAssetId] ?? null;
if (
!$source || !$target || $source->name !== $sourceName
|| $target->name !== $targetName
) {
throw new \RuntimeException('COM_JLMS_SAVE_FAILED');
}
if ((int) $source->parent_id === $targetAssetId) {
return;
}

$left = (int) $source->lft;
$right = (int) $source->rgt;
$destination = (int) $target->rgt;
if ($left < 1 || $right <= $left || ($destination >= $left && $destination <= $right)) {
throw new \RuntimeException('COM_JLMS_SAVE_FAILED');
}
$width = $right - $left + 1;
$movingRight = $destination > $right;
$newLeft = $movingRight ? $destination - $width : $destination;
$delta = $newLeft - $left;
$shift = $movingRight ? -$width : $width;
$shiftLeft = $movingRight ? $right + 1 : $destination;
$shiftRight = $movingRight ? $destination - 1 : $left - 1;
$rangeStart = min($left, $destination);
$rangeEnd = max($right, $destination - 1);
$levelDelta = (int) $target->level + 1 - (int) $source->level;

// Update depth while the original subtree coordinates still exist.
$query = $db->createQuery()->update('#__assets')
->set('level = level + :levelDelta')
->where('lft >= :left')->where('rgt <= :right')
->bind(':levelDelta', $levelDelta, ParameterType::INTEGER)
->bind(':left', $left, ParameterType::INTEGER)
->bind(':right', $right, ParameterType::INTEGER);
$db->setQuery($query)->execute();

// Each coordinate is transformed independently. The intervening
// interval closes the old gap and opens the new one in the same move.
foreach (['lft', 'rgt'] as $coordinate) {
$column = $db->quoteName($coordinate);
$query = $db->createQuery()->update('#__assets')
->set($column . ' = CASE WHEN ' . $column . ' BETWEEN :sourceLeft AND :sourceRight'
. ' THEN ' . $column . ' + :delta WHEN ' . $column . ' BETWEEN :shiftLeft AND :shiftRight'
. ' THEN ' . $column . ' + :shift ELSE ' . $column . ' END')
->where($column . ' BETWEEN :rangeStart AND :rangeEnd')
->bind(':sourceLeft', $left, ParameterType::INTEGER)
->bind(':sourceRight', $right, ParameterType::INTEGER)
->bind(':delta', $delta, ParameterType::INTEGER)
->bind(':shiftLeft', $shiftLeft, ParameterType::INTEGER)
->bind(':shiftRight', $shiftRight, ParameterType::INTEGER)
->bind(':shift', $shift, ParameterType::INTEGER)
->bind(':rangeStart', $rangeStart, ParameterType::INTEGER)
->bind(':rangeEnd', $rangeEnd, ParameterType::INTEGER);
$db->setQuery($query)->execute();
}
$assetParentUpdate = (object) ['id' => $assetId, 'parent_id' => $targetAssetId];
$db->updateObject('#__assets', $assetParentUpdate, 'id');
}
}
74 changes: 7 additions & 67 deletions component/administrator/src/Table/PathwayTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,73 +101,13 @@ public function check(): bool
*/
public function moveCategoryAsset(int $targetAssetId): void
{
$db = $this->getDatabase();
$assetId = (int) $this->asset_id;
$query = $db->createQuery()->select('id, name, parent_id, lft, rgt, level')
->from('#__assets')->where('id IN (:asset, :target)')
->bind(':asset', $assetId, ParameterType::INTEGER)
->bind(':target', $targetAssetId, ParameterType::INTEGER);
$query->setQuery((string) $query . ' FOR UPDATE');
$rows = $db->setQuery($query)->loadObjectList('id');
$source = $rows[$assetId] ?? null;
$target = $rows[$targetAssetId] ?? null;
if (
!$source || !$target || $source->name !== $this->_getAssetName()
|| $target->name !== 'com_jlms.pathway.category.' . (int) $this->catid
) {
throw new \RuntimeException('COM_JLMS_SAVE_FAILED');
}
if ((int) $source->parent_id === $targetAssetId) {
return;
}

$left = (int) $source->lft;
$right = (int) $source->rgt;
$destination = (int) $target->rgt;
if ($left < 1 || $right <= $left || ($destination >= $left && $destination <= $right)) {
throw new \RuntimeException('COM_JLMS_SAVE_FAILED');
}
$width = $right - $left + 1;
$movingRight = $destination > $right;
$newLeft = $movingRight ? $destination - $width : $destination;
$delta = $newLeft - $left;
$shift = $movingRight ? -$width : $width;
$shiftLeft = $movingRight ? $right + 1 : $destination;
$shiftRight = $movingRight ? $destination - 1 : $left - 1;
$rangeStart = min($left, $destination);
$rangeEnd = max($right, $destination - 1);
$levelDelta = (int) $target->level + 1 - (int) $source->level;

// Update depth while the original subtree coordinates still exist.
$query = $db->createQuery()->update('#__assets')
->set('level = level + :levelDelta')
->where('lft >= :left')->where('rgt <= :right')
->bind(':levelDelta', $levelDelta, ParameterType::INTEGER)
->bind(':left', $left, ParameterType::INTEGER)
->bind(':right', $right, ParameterType::INTEGER);
$db->setQuery($query)->execute();

// Each coordinate is transformed independently. The intervening
// interval closes the old gap and opens the new one in the same move.
foreach (['lft', 'rgt'] as $coordinate) {
$column = $db->quoteName($coordinate);
$query = $db->createQuery()->update('#__assets')
->set($column . ' = CASE WHEN ' . $column . ' BETWEEN :sourceLeft AND :sourceRight'
. ' THEN ' . $column . ' + :delta WHEN ' . $column . ' BETWEEN :shiftLeft AND :shiftRight'
. ' THEN ' . $column . ' + :shift ELSE ' . $column . ' END')
->where($column . ' BETWEEN :rangeStart AND :rangeEnd')
->bind(':sourceLeft', $left, ParameterType::INTEGER)
->bind(':sourceRight', $right, ParameterType::INTEGER)
->bind(':delta', $delta, ParameterType::INTEGER)
->bind(':shiftLeft', $shiftLeft, ParameterType::INTEGER)
->bind(':shiftRight', $shiftRight, ParameterType::INTEGER)
->bind(':shift', $shift, ParameterType::INTEGER)
->bind(':rangeStart', $rangeStart, ParameterType::INTEGER)
->bind(':rangeEnd', $rangeEnd, ParameterType::INTEGER);
$db->setQuery($query)->execute();
}
$assetParentUpdate = (object) ['id' => $assetId, 'parent_id' => $targetAssetId];
$db->updateObject('#__assets', $assetParentUpdate, 'id');
\Jlms\Component\Jlms\Administrator\Infrastructure\CategoryAssetRelocation::move(
$this->getDatabase(),
(int) $this->asset_id,
$this->_getAssetName(),
$targetAssetId,
'com_jlms.pathway.category.' . (int) $this->catid
);
}

public function store($updateNulls = true)
Expand Down
2 changes: 1 addition & 1 deletion component/jlms.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" method="upgrade">
<name>COM_JLMS</name><author>Jecko Development</author><version>0.70.12</version>
<name>COM_JLMS</name><author>Jecko Development</author><version>0.70.13</version>
<description>COM_JLMS_XML_DESCRIPTION</description><namespace path="src">Jlms\Component\Jlms</namespace>
<scriptfile>script.php</scriptfile>
<files folder="site"><folder>forms</folder><folder>src</folder><folder>tmpl</folder><folder>language</folder></files>
Expand Down
2 changes: 1 addition & 1 deletion component/media/joomla.asset.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_jlms",
"version": "0.70.12",
"version": "0.70.13",
"assets": [
{
"name": "com_jlms.site",
Expand Down
Loading
Loading