Neos.Neos/Classes/Domain/Service/UserService.php
public function deleteUser(User $user)
    {
        foreach ($user->getAccounts() as $account) {
            $this->securityContext->withoutAuthorizationChecks(function () use ($account) {
                $this->deletePersonalWorkspace($account->getAccountIdentifier());
            });

            $this->accountRepository->remove($account);
        }

        $this->removeOwnerFromUsersWorkspaces($user);

        $this->partyRepository->remove($user);
        $this->emitUserDeleted($user);
    }
public function deleteUser(User $user)
    {
        foreach ($user->getAccounts() as $account) {
            $this->securityContext->withoutAuthorizationChecks(function () use ($account) {
                $this->deletePersonalWorkspace($account->getAccountIdentifier());
            });

            $this->accountRepository->remove($account);
        }

        $this->removeOwnerFromUsersWorkspaces($user);

        $this->partyRepository->remove($user);
        $this->emitUserDeleted($user);
    }
public function deleteUser ( User $ user ) { foreach ( $ user -> getAccounts ( ) as $ account ) { $ this -> securityContext -> withoutAuthorizationChecks ( function ( ) use ( $ account ) { $ this -> deletePersonalWorkspace ( $ account -> getAccountIdentifier ( ) ) ; } ) ; $ this -> accountRepository -> remove ( $ account ) ; } $ this -> removeOwnerFromUsersWorkspaces ( $ user ) ; $ this -> partyRepository -> remove ( $ user ) ; $ this -> emitUserDeleted ( $ user ) ; }
Deletes the specified user and all remaining content in his personal workspaces

@param User $user The user to delete
@return void
@throws Exception
@api
Deletes the specified user and all remaining content in his personal workspaces