Permissions for REST API

I’m tinkering again with the Omeka-S 2.1.2 REST API and I’ve reached a permissions problem. I can PATCH successfully, but when I try to POST a new item using the same credentials, it tells me “Permission denied for the current user to create the Omeka\Api\Adapter\ItemAdapter resource.” The user is the global administrator, so presumably should have permission to do this. Is there some configuration I need to tweak to allow this?

Stack trace from the application log:

 Permission denied for the current user to create the Omeka\Api\Adapter\ItemAdapter resource. in [...]/application/src/Api/Manager.php:208
Stack trace:
#0 [...]/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#1 [...]/application/src/Controller/ApiController.php(96): Omeka\Api\Manager->create('items', Array, Array)
#2 [...]/application/src/Controller/ApiController.php(172): Omeka\Controller\ApiController->create(Array, Array)
#3 [...]/vendor/zendframework/zend-mvc/src/Controller/AbstractRestfulController.php(429): Omeka\Controller\ApiController->processPostData(Object(Zend\Http\PhpEnvironment\Request))
#4 [...]/application/src/Controller/ApiController.php(145): Zend\Mvc\Controller\AbstractRestfulController->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 [...]/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Omeka\Controller\ApiController->onDispatch(Object(Zend\Mvc\MvcEvent))
#6 [...]/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 [...]/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(104): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#8 [...]/vendor/zendframework/zend-mvc/src/Controller/AbstractRestfulController.php(313): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#9 [...]/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractRestfulController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#10 [...]/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#11 [...]/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 [...]/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#13 [...]/index.php(21): Zend\Mvc\Application->run()
#14 {main}

You’re sure you’re passing the correct API credentials when you’re trying this?

The permission being checked here is the same for the API and the normal interface, so if you’re using the proper credentials, this same user should have the same error happen when trying to create an item through the regular web interface (if so that would indicate some general permissions issue… possibly from a module or manual changes to the ACL?)

Hmm, looks like I’ve messed something up. I’ll dig into it this evening.

My bad; sorry for the false alarm.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.