[ TaoItemsRoles::ITEM_CLASS_SCHEMA_MANAGER => [ ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'editItemClass'], ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'addClassProperty'], ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'removeClassProperty'], ['ext' => 'taoItems', 'mod' => 'Category', 'act' => 'getExposedsByClass'], ['ext' => 'taoItems', 'mod' => 'Category', 'act' => 'setExposed'], Lists::class . '@getListElements', ], TaoItemsRoles::ITEM_VIEWER => [ ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'editItem'], ], TaoItemsRoles::ITEM_REPLICATOR => [ ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'cloneInstance'], ['ext' => 'taoItems', 'mod' => 'Items', 'act' => 'copyInstance'], ], TaoItemsRoles::ITEM_PREVIEWER => [ ['ext' => 'taoItems', 'mod' => 'ItemPreview', 'act' => 'index'], ], ], SetRolesAccess::CONFIG_PERMISSIONS => [ taoItems_actions_Items::class => [ 'editItem' => [ TaoItemsRoles::ITEM_VIEWER => ActionAccessControl::READ, TaoItemsRoles::ITEM_PROPERTIES_EDITOR => ActionAccessControl::WRITE, ], ], ], ]; public function getDescription(): string { return 'Create new item 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, ]); } }