Revert "[FEATURE] Add userGroups to backendUser model"
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Apr 2013 12:44:10 +0000 (14:44 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 29 Apr 2013 12:56:12 +0000 (14:56 +0200)
This reverts commit ba746497220ad5f7244415742c171bb6f8143d3c

Backend user groups are a graph in CMS core. This is not reflected
by the current implementation. The feature is reverted to not add
a half baked solution.

Change-Id: I3b7ee94d5bfe72cc7530144bb681e8a913786a16
Releases: 6.2, 6.1
Related: #39329
Reviewed-on: https://review.typo3.org/20298
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/Domain/Model/BackendUser.php
typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserTest.php
typo3/sysext/extbase/ext_typoscript_setup.txt

index df95e03..25b4e79 100644 (file)
@@ -46,11 +46,6 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $isAdministrator = FALSE;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup>
-        */
-       protected $backendUserGroups = NULL;
-
-       /**
         * @var boolean
         */
        protected $isDisabled = FALSE;
@@ -94,7 +89,7 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         * Constructs this backend user
         */
        public function __construct() {
-               $this->initializeObject();
+               $this->fileMounts = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
        }
 
        /**
@@ -104,7 +99,6 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
         */
        public function initializeObject() {
                $this->fileMounts = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->backendUserGroups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
        }
 
        /**
@@ -146,54 +140,6 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * Getter for the backend user groups
-        *
-        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup>
-        */
-       public function getBackendUserGroups() {
-               return $this->backendUserGroups;
-       }
-
-       /**
-        * Setter for the backend user groups
-        *
-        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $backendUserGroups
-        * @return void
-        */
-       public function setBackendUserGroups(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $backendUserGroups) {
-               $this->backendUserGroups = $backendUserGroups;
-       }
-
-       /**
-        * Adds a backend user group to this backend user
-        *
-        * @param \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $backendUserGroup
-        * @return void
-        */
-       public function addBackendUserGroup(\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $backendUserGroup) {
-               $this->backendUserGroups->attach($backendUserGroup);
-       }
-
-       /**
-        * Removes backend user group from this backend user
-        *
-        * @param \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $backendUserGroup
-        * @return void
-        */
-       public function removeBackendUserGroup(\TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup $backendUserGroup) {
-               $this->backendUserGroups->detach($backendUserGroup);
-       }
-
-       /**
-        * Remove all backend user groups from this backend user
-        *
-        * @return void
-        */
-       public function removeAllBackendUserGroups() {
-               $this->backendUserGroups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-       }
-
-       /**
         * Checks whether this user is disabled.
         *
         * @return boolean whether this user is disabled
index 92fe665..5655f73 100644 (file)
@@ -81,64 +81,6 @@ class BackendUserTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @test
         */
-       public function getBackendUserGroupsInitiallyReturnsEmptyStorage() {
-               $this->assertEquals(new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(), $this->fixture->getBackendUserGroups());
-       }
-
-       /**
-        * @test
-        */
-       public function setBackendUserGroupsSetsBackendUserGroups() {
-               $backendUserGroups = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $group1 = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
-               $backendUserGroups->attach($group1);
-
-               $this->fixture->setBackendUserGroups($backendUserGroups);
-               $this->assertSame(
-                       $backendUserGroups,
-                       $this->fixture->getBackendUserGroups()
-               );
-       }
-
-       /**
-        * @test
-        */
-       public function addBackendUserGroupAddsBackendUserGroup() {
-               $group1 = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
-
-               $this->fixture->addBackendUserGroup($group1);
-               $this->assertTrue($this->fixture->getBackendUserGroups()->contains($group1));
-       }
-
-       /**
-        * @test
-        */
-       public function removeBackendUserGroupRemovesBackendUserGroup() {
-               $group1 = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
-
-               $this->fixture->addBackendUserGroup($group1);
-               $this->fixture->removeBackendUserGroup($group1);
-               $this->assertFalse($this->fixture->getBackendUserGroups()->contains($group1));
-       }
-
-       /**
-        * @test
-        */
-       public function removeAllBackendUserGroupsRemovesAllBackendUserGroups() {
-               $group1 = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
-               $group2 = new \TYPO3\CMS\Extbase\Domain\Model\BackendUserGroup();
-
-               $this->fixture->addBackendUserGroup($group1);
-               $this->fixture->addBackendUserGroup($group2);
-               $this->fixture->removeAllBackendUserGroups();
-
-               $this->assertFalse($this->fixture->getBackendUserGroups()->contains($group1));
-               $this->assertFalse($this->fixture->getBackendUserGroups()->contains($group2));
-       }
-
-       /**
-        * @test
-        */
        public function getIsDisabledInitiallyReturnsFalse() {
                $this->assertFalse($this->fixture->getIsDisabled());
        }
index 75b59f7..88ef842 100644 (file)
@@ -37,7 +37,6 @@ config.tx_extbase {
                                        columns {
                                                username.mapOnProperty = userName
                                                admin.mapOnProperty = isAdministrator
-                                               usergroup.mapOnProperty = backendUserGroups
                                                disable.mapOnProperty = isDisabled
                                                realName.mapOnProperty = realName
                                                starttime.mapOnProperty = startDateAndTime