Skip to content

Commit

Permalink
Merge pull request #64 from oat-sa/fix/anonymous-rest-access
Browse files Browse the repository at this point in the history
Fix anonymous access right
  • Loading branch information
siwane authored May 8, 2017
2 parents d546396 + 8e1584d commit a311d61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
20 changes: 10 additions & 10 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
}
}
}

0 comments on commit a311d61

Please sign in to comment.