Remove user of this object
through the user_role cross reference table.

@param ChildUser $user
@return ChildRole The current object (for fluent API support)
181577
public function removeUser(ChildUser $user)
    {
        if ($this->getUsers()->contains($user)) { $userRole = new ChildUserRole();

            $userRole->setUser($user);
            if ($user->isRolesLoaded()) {
                //remove the back reference if available
                $user->getRoles()->removeObject($this);
            }

            $userRole->setRole($this);
            $this->removeUserRole(clone $userRole);
            $userRole->clear();

            $this->collUsers->remove($this->collUsers->search($user));

            if (null === $this->usersScheduledForDeletion) {
                $this->usersScheduledForDeletion = clone $this->collUsers;
                $this->usersScheduledForDeletion->clear();
            }

            $this->usersScheduledForDeletion->push($user);
        }


        return $this;
    }
508460
public function deleteUser($user)
    {
        $params = [
            'name' => $user,
        ];

        $body = $this->request(self::URI_AUTH_USER_DELETE, $params);

        return $body;
    }
93028
public function delete(User $user, User $successor = null)
    {
        require_once ABSPATH.'wp-admin/includes/user.php';

        if ($successor instanceof User) {
            $successor = $successor->id;
        }

        return wp_delete_user($user->id, $successor);
    }
420129
public function removeUser($user)
    {
        $username = ($user instanceof UserInformation) ? $user->getUsername() : (string) $user;

        $this->configSource->set('auth-password/' . $username, null);

        return $this;
    }
1307784
public function setUser(User $user = null): FamilyPermission
    {
        $this->user = $user;
        if ($user && !$user->getFamilyPermissions()->contains($this)) {
            $user->getFamilyPermissions()->add($this);
        }

        return $this;
    }
1081868
public function revokeUserRole($user, $role)
    {
        $params = [
            'name' => $user,
            'role' => $role,
        ];

        $body = $this->request(self::URI_AUTH_USER_REVOKE, $params);

        return $body;
    }
701614
public function destroy(User $user, $force = false)
    {
        if ($user->id <> auth('administrator')->id()) {
            try {
                if ($force) {
                    $user->forceDelete();
                } else {
                    $user->delete();
                }

                return $this->notifySuccess('User successfully deleted!');
            } catch (QueryException $e) {
                return $this->notifyError($e->getMessage());
            }
        }

        return $this->notifyError('You cannot delete your own record!');
    }
63321
public function removeMyFriend(\CsnUser\Entity\User $user)
    {
        $user->removeFriendWithMe($this); // synchronously updating inverse side.
        $this->myFriends->removeElement($user);

        return $this;
    }
1186197
public function forUser($user)
    {
        $callback = function () use ($user)
        {
            return $user;
        };

        return new static(
            $this->container, $callback, $this->abilities,
            $this->policies, $this->beforeCallbacks, $this->afterCallbacks
        );
    }
940963
public function delete($userRoleLinker, $tableName = null)
    {
        $this->checkEntity($userRoleLinker);

        return parent::delete(array('user_id' => $userRoleLinker->getUserId(), 'role_id' => $userRoleLinker->getRoleId()));
    }
940874
public function detachUser( $user )
  {
    if( is_object($user))
      $user = $user->getKey();

    if( is_array($user))
      $user = $user['id'];

    $this->users()->detach( $user );
  }
739110
public function deleteUser(User $user)
    {
        if ($user->isGuest()) {
            Throw new UserException('Cannot delete a guest user.');
        }

        // Check the old password
        $this->db->delete($this->table, 'id_user=:id_user', [
            ':id_user' => $user->getId()
        ]);
    }
154105
public function setUser($user)
    {
        $this->removeTarget();

        if ($user) {
            $this->user = (string) $user;
        }

        return $this;
    }
1098472
public function getRolesFor(User $user)
    {

        $userRoles = $user->roles()->get();

        $roles  = Role::where('order', '<=', $this->maxRole()->order);

        foreach ($userRoles as $role) {
            $roles = $roles->where('name', '!=', $role->name);
        }

        return $roles->get();
    }
510409
public function removeUserRole(\CanalTP\SamCoreBundle\Entity\Role $userRole)
    {
        $this->userRoles->removeElement($userRole);
    }
334002
protected function CanEdit(User $user)
    {
        return self::Guard()->Allow(BackendAction::Edit(), $user)&&
            self::Guard()->Allow(BackendAction::UseIt(), new UserForm());
    }
794968
public function addUserRole(ChildUserRole $l)
    {
        if ($this->collUserRoles === null) {
            $this->initUserRoles();
            $this->collUserRolesPartial = true;
        }

        if (!$this->collUserRoles->contains($l)) {
            $this->doAddUserRole($l);
        }

        return $this;
    }