UIUCLibrary / teams

An Omeka S module to manage restrictions for users, sites and resources
GNU General Public License v3.0
6 stars 2 forks source link

Compatibility with Collecting #91

Closed tatipovo closed 1 year ago

tatipovo commented 2 years ago

Currently teams is incompatible with Collecting. If an omeka supervisor/teams admin tries to administer a submission made through Collecting (edit the submitted item before marking it public), they receive an error related to the item not being in their team:

Permission denied. Resource "Omeka\Entity\Item: 4661" is not part of your current team, BCCMR. If you feel this is an error, try changing teams or talk to the administrator. Action: read Forbidden Omeka\Api\Exception\PermissionDeniedException: Permission denied. Resource "Omeka\Entity\Item: 4661" is not part of your current team, BCCMR. If you feel this is an error, try changing teams or talk to the administrator. Action: read in /home/u866347951/domains/craftarchive.ca/public_html/modules/Teams/Module.php:2185 Stack trace:

0 /home/u866347951/domains/craftarchive.ca/public_html/modules/Teams/Module.php(2330): Teams\Module->teamAuthority(Object(Omeka\Entity\Item), 'read', Object(Laminas\EventManager\Event))

1 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Teams\Module->teamAuthorizeOnRead(Object(Laminas\EventManager\Event))

2 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event))

3 /home/u866347951/domains/craftarchive.ca/public_html/application/src/Api/Adapter/AbstractEntityAdapter.php(433): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event))

4 /home/u866347951/domains/craftarchive.ca/public_html/application/src/Api/Manager.php(230): Omeka\Api\Adapter\AbstractEntityAdapter->read(Object(Omeka\Api\Request))

5 /home/u866347951/domains/craftarchive.ca/public_html/application/src/Api/Manager.php(115): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))

6 /home/u866347951/domains/craftarchive.ca/public_html/application/src/Mvc/Controller/Plugin/Api.php(136): Omeka\Api\Manager->read('items', '4661', Array, Array)

7 /home/u866347951/domains/craftarchive.ca/public_html/application/src/Controller/Admin/ItemController.php(62): Omeka\Mvc\Controller\Plugin\Api->read('items', '4661')

8 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ItemController->showAction()

9 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))

10 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

11 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(103): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

12 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))

13 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))

14 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))

15 /home/u866347951/domains/craftarchive.ca/public_html/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))

16 /home/u866347951/domains/craftarchive.ca/public_html/index.php(21): Laminas\Mvc\Application->run()

17 {main}

If logged in as an Omeka Global admin/teams admin, I am allowed to edit a submitted item and add it to a team from the edit screen. My case would make assigning more users as global admins undesirable.

Ideally a solution would offer an item to be automatically added to the team that the logged in user belongs to, or offer an option to choose which team the item will be assigned to.

Thank you!!!

alexdryden commented 2 years ago

Thanks for the report, @tatipovo! I haven't used Collecting extensively, but based on your description this shouldn't be too hard to implement. After some investigating, the Collecting module sounds like a thing that our authors could be interested in, and I'd be happy to add interoperability support to Teams.