diff --git a/manifest.php b/manifest.php index 78fec0b3..4ee21d8d 100755 --- a/manifest.php +++ b/manifest.php @@ -33,7 +33,7 @@ 'label' => 'Test-taker core extension', 'description' => 'TAO TestTaker extension', 'license' => 'GPL-2.0', - 'version' => '3.0.0', + 'version' => '3.0.1', 'author' => 'Open Assessment Technologies, CRP Henri Tudor', 'requires' => array( 'taoBackOffice' => '>=0.8' @@ -49,9 +49,7 @@ 'update' => "oat\\taoTestTaker\\scripts\\update\\Updater", 'managementRole' => 'http://www.tao.lu/Ontologies/TAOSubject.rdf#SubjectsManagerRole', 'acl' => array( - array('grant', 'http://www.tao.lu/Ontologies/TAOSubject.rdf#SubjectsManagerRole', array('ext'=>'taoTestTaker')), - array('grant', 'http://www.tao.lu/Ontologies/generis.rdf#AnonymousRole',array('ext'=>'taoTestTaker','mod' => 'Api')) - + array('grant', 'http://www.tao.lu/Ontologies/TAOSubject.rdf#SubjectsManagerRole', array('ext'=>'taoTestTaker')) ), 'routes' => array( '/taoTestTaker' => 'oat\\taoTestTaker\\actions' diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index 4b5b1a74..cb406929 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -21,6 +21,10 @@ namespace oat\taoTestTaker\scripts\update; +use oat\tao\model\accessControl\func\AclProxy; +use oat\tao\model\accessControl\func\AccessRule; +use oat\tao\model\user\TaoRoles; +use oat\taoTestTaker\actions\Api; /** * Class Updater * @package oat\taoTestTaker\scripts\update @@ -34,15 +38,11 @@ class Updater extends \common_ext_ExtensionUpdater */ public function update($initialVersion) { - $currentVersion = $initialVersion; - if ($currentVersion == '2.6' || $currentVersion == '2.6.1' || $currentVersion == '2.7') { - $currentVersion = '2.7.1'; - } - - $this->setVersion($currentVersion); - - $this->skip('2.7.1', '3.0.0'); - - return null; + $this->skip('2.6', '3.0.0'); + // fix anonymous access + if ($this->isVersion('3.0.0')) { + AclProxy::revokeRule(new AccessRule(AccessRule::GRANT, TaoRoles::ANONYMOUS, Api::class)); + $this->setVersion('3.0.1'); + } } }