Details
-
Bug
-
Resolution: Fixed
-
High
-
5.1-dev
-
Server OS: Red Hat 6
PHP: 5.3.3
Database: MySQL 5.1.61
Browser: Firefox 18.0.1
-
Stetind Sprint 7
Description
Editor user permissions aren't working as expected.
If we run the following script:
public function testEditorPermissions() { $userService = $this->repo->getUserService(); // create a new Editor User $newUser = $userService->newUserCreateStruct( "one", "one@one.com", "one", "eng-GB" ); $newUser->setField( "first_name", "One" ); $newUser->setField( "last_name", "One" ); $user = $userService->createUser( $newUser, array($userService->loadUserGroup( 13 )) ); // 13 = editors // login with the recently created user $this->repo->setCurrentUser( $user ); // make a folder $contentTypeService = $this->repo->getContentTypeService(); $contentService = $this->repo->getContentService(); $locationService = $this->repo->getLocationService(); $newContent = $contentService->newContentCreateStruct( $contentTypeService->loadContentTypeByIdentifier( "folder" ), $this->api->lang ); $newContent->setField( "name", "News"); // make new location $newLocation = $locationService->newLocationCreateStruct( 2 ); // 2 = "/" (root) // save content and location $contentService->publishVersion( $contentService->createContent( $newContent, array( $newLocation ) )->getVersionInfo() ); }
We will get an error:
eZ\Publish\Core\Base\Exceptions\UnauthorizedException: User does not have access to 'read' 'content' /var/www/apache2php53/ezp5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php:299 /var/www/apache2php53/ezp5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php:1319 /var/www/apache2php53/ezp5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php:416 /var/www/apache2php53/ezp5/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapiexample.php:32 // publishVersion /var/www/apache2php53/ezp5/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:753 /var/www/apache2php53/ezp5/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372