Removes the passed principal from the group.

@param \AppserverIo\Psr\Security\PrincipalInterface $principal The principal to remove

@return boolean TRUE if the member was successfully removed, FALSE if the principal was not a member
350468
public function removeMember(PrincipalInterface $principal)
    {

        // query whether or not the passed principal is a member of this group
        if ($this->members->exists($principal->getName())) {
            // remove the princial and return TRUE
            $this->members->remove($principal->getName());
            return true;
        }

        // return FALSE, if not
        return false;
    }
764110
public static function remove($threads = [])
    {
        try {
            if (!empty($threads)) {
                return Podium::getInstance()->db->createCommand()->delete(
                        Subscription::tableName(), ['id' => $threads, 'user_id' => User::loggedId()]
                    )->execute();
            }
        } catch (Exception $e) {
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
1022262
public function removeRole(ChildRole $role)
    {
        if ($this->getRoles()->contains($role)) { $rolePermission = new ChildRolePermission();

            $rolePermission->setRole($role);
            if ($role->isPermissionsLoaded()) {
                //remove the back reference if available
                $role->getPermissions()->removeObject($this);
            }

            $rolePermission->setPermission($this);
            $this->removeRolePermission(clone $rolePermission);
            $rolePermission->clear();

            $this->collRoles->remove($this->collRoles->search($role));

            if (null === $this->rolesScheduledForDeletion) {
                $this->rolesScheduledForDeletion = clone $this->collRoles;
                $this->rolesScheduledForDeletion->clear();
            }

            $this->rolesScheduledForDeletion->push($role);
        }


        return $this;
    }
972986
public function removeRole(RoleInterface $role)
    {
        $this->roles->removeElement($role);

        if ($role->hasUser($this) === true)
            $role->removeUser($this);
        
        return $this;
    }
1069295
protected function userIsAllowed(TokenInterface $token)
    {
        /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */
        foreach ($this->hierarchy->getReachableRoles($token->getRoles()) as $role) {
            if ($role->getRole() === self::ROLE_ADMIN_MENU_ITEM) {
                return true;
            }
        }
        return false;
    }
321047
public function remove($key): CollectionInterface
    {
        foreach ($this->indexes as $index) {
            $index->remove($key);
        }

        return parent::remove($key);
    }
377262
public function canDelete(GroupInterface $group, array $parameters)
    {
        $nbrGroupsUsers = $parameters;
        if (!array_key_exists($group->getId(), $nbrGroupsUsers)) {
            $nbrGroupsUsers = $this->userRepository->getCountsUsersByGroups(array($group->getId()));
        }

        return 0 === $nbrGroupsUsers[$group->getId()];
    }
749466
public function deleteEntity(EntityInterface $entity)
    {
        $delete = $this->tableGateway->getSql()->delete();
        $delete->where->equalTo(
            $this->tableGateway->getPrimaryKey(), $entity->getIdentifier()
        );

        try {
            $this->tableGateway->deleteWith($delete);
        } catch (RuntimeException $e) {
            return false;
        }

        return true;
    }
368350
public function removeRole($role)
    {
        $roleElement = $this->getRole($role);
        if ($roleElement) {
            $this->roles->removeElement($roleElement);
        }

        return $this;
    }
640530
public function leave(RoleInterface $role)
    {
        $this->roles()
            ->detach($role);

        return $this->isnt($role);
    }
873719
public function removeUser($groupName, $username)
    {
        $groupDn = $this->dn($groupName);

        $userDn = $this->adldap->user()->dn($username);

        if (is_string($groupDn) && is_string($userDn)) {
            $del = [];
            $del['member'] = $userDn;

            return $this->connection->modDelete($groupDn, $del);
        }

        return false;
    }
761077
public function removeUser(UserInterface $user)
    {
        $this->users->removeElement($user);

        if ($user->hasRole($this) === true)
            $user->removeRole($this);
        
        return $this;
    }
950160
public function preDelete(ConnectionInterface $con = null)
    {
        parent::preDelete($con);

        if ($this->getIsDefault()) {
            return false;
        }

        $this->dispatchEvent(TheliaEvents::BEFORE_DELETEADDRESS, new AddressEvent($this));

        return true;
    }
479737
public function destroy(Role $role)
    {
        if (! $role->system) {
            try {
                $role->delete();

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

        return $this->notifyError('Role is protected and cannot be deleted!');
    }
98565
public function removeGroup(GroupInterface $group)
    {
        if ($this->hasGroup($group)) {
            $this->groups->removeElement($group);
        }

        return $this;
    }
172376
public function removeRole($role)
    {
        $key = array_search(strtoupper($role), $this->roles, true);
        if (false !== $key) {
            /** @var string $key */
            unset($this->roles[$key]);
            $this->roles = array_values($this->roles);
        }

        return $this;
    }
523698
public function remove(int $primaryKey) : bool
    {
        foreach ($this->rows as $key => $row) {
            if ($row->getColumn($this->primaryKey) === $primaryKey) {
                unset($this->rows[$key]);
                return true;
            }
        }

        return false;
    }