[ TaoAssetRoles::ASSET_CLASS_NAVIGATOR => [ ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'editClassLabel'], ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'index'], ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'getOntologyData'] ], TaoAssetRoles::ASSET_VIEWER => [ ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'editInstance'], ['ext' => 'taoMediaManager', 'mod' => 'SharedStimulus', 'act' => 'get'], ], TaoAssetRoles::ASSET_EXPORTER => [ ['ext' => 'taoMediaManager', 'mod' => 'MediaExport', 'act' => 'index'], ], TaoAssetRoles::ASSET_PREVIEWER => [ ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'getFile'], ['ext' => 'taoItems', 'mod' => 'ItemContent', 'act' => 'files'], ['ext' => 'taoItems', 'mod' => 'ItemContent', 'act' => 'download'], ], TaoAssetRoles::ASSET_CONTENT_CREATOR => [ ['ext' => 'taoMediaManager', 'mod' => 'MediaManager', 'act' => 'authoring'], ['ext' => 'taoMediaManager', 'mod' => 'MediaImport', 'act' => 'editMedia'], ['ext' => 'taoMediaManager', 'mod' => 'SharedStimulus', 'act' => 'patch'], ], ], SetRolesAccess::CONFIG_PERMISSIONS => [ MediaManager::class => [ 'editClassLabel' => [ TaoAssetRoles::ASSET_CLASS_NAVIGATOR => ActionAccessControl::READ ], 'editInstance' => [ TaoAssetRoles::ASSET_VIEWER => ActionAccessControl::READ, TaoAssetRoles::ASSET_PROPERTIES_EDITOR => ActionAccessControl::WRITE, ], ], taoItems_actions_ItemContent::class => [ 'files' => [ TaoAssetRoles::ASSET_CLASS_NAVIGATOR => ActionAccessControl::DENY, TaoAssetRoles::ASSET_PREVIEWER => ActionAccessControl::READ, ], ], ], ]; public function getDescription(): string { return 'Create new asset management roles and assign permissions to them'; } public function up(Schema $schema): void { OntologyUpdater::syncModels(); $setRolesAccess = $this->propagate(new SetRolesAccess()); $setRolesAccess([ '--' . SetRolesAccess::OPTION_CONFIG, self::CONFIG, ]); } public function down(Schema $schema): void { $setRolesAccess = $this->propagate(new SetRolesAccess()); $setRolesAccess([ '--' . SetRolesAccess::OPTION_REVOKE, '--' . SetRolesAccess::OPTION_CONFIG, self::CONFIG, ]); } }