Ejemplo n.º 1
0
 public function onBootstrap(MvcEvent $event)
 {
     parent::onBootstrap($event);
     $acl = $this->getServiceLocator()->get('Omeka\\Acl');
     $acl->allow(null, 'CustomVocab\\Controller\\Index', ['browse', 'show-details']);
     $acl->allow(null, 'CustomVocab\\Api\\Adapter\\CustomVocabAdapter', ['search', 'read']);
     $acl->allow(null, 'CustomVocab\\Entity\\CustomVocab', ['read']);
     $acl->allow('editor', 'CustomVocab\\Controller\\Index', ['add', 'edit', 'delete']);
     $acl->allow('editor', 'CustomVocab\\Api\\Adapter\\CustomVocabAdapter', ['create', 'update', 'delete']);
     $acl->allow('editor', 'CustomVocab\\Entity\\CustomVocab', 'create');
     $acl->allow('editor', 'CustomVocab\\Entity\\CustomVocab', ['update', 'delete'], new OwnsEntityAssertion());
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function onBootstrap(MvcEvent $event)
 {
     $this->configureSession();
     parent::onBootstrap($event);
     $serviceManager = $this->getServiceLocator();
     $viewHelperManager = $serviceManager->get('ViewHelperManager');
     // Set the custom form row partial.
     $viewHelperManager->get('formRow')->setPartial('common/form-row');
     // Inject the service manager into view helpers that need it.
     foreach ($this->viewHelpers as $helperName => $helperClass) {
         $viewHelperManager->setFactory($helperName, function ($helperPluginManager) use($helperClass, $serviceManager) {
             return new $helperClass($serviceManager);
         });
     }
     // Set the ACL to navigation.
     $acl = $serviceManager->get('Omeka\\Acl');
     $navigation = $viewHelperManager->get('Navigation');
     $navigation->setAcl($acl);
     // Set the timezone.
     if ($serviceManager->get('Omeka\\Status')->isInstalled()) {
         $settings = $serviceManager->get('Omeka\\Settings');
         date_default_timezone_set($settings->get('time_zone', 'UTC'));
     }
 }
Ejemplo n.º 3
0
 public function onBootstrap(MvcEvent $event)
 {
     parent::onBootstrap($event);
     $acl = $this->getServiceLocator()->get('Omeka\\Acl');
     $acl->allow(null, 'Sharing\\Controller\\Index');
 }