remove a single role
348172
def remove_role role
      raise ArgumentError, '#remove_role takes a single role String or Symbol as the argument' if !role || role.kind_of?(Array)
      remove_roles role
    end
133269
public function removeRole($roleName)
    {
        if (true === is_string($roleName) && true === in_array($roleName, $this->roles)) {
            foreach (array_keys($this->roles, (string)$roleName, true) as $key) {
                unset($this->roles[$key]);
            }
        }
        return $this;
    }
698204
def delete_role(self, name):
    
    return roles.delete_role(self._get_resource_root(), self.name, name,
        self._get_cluster_name())
242178
def delete_role_perm(role_id, perm_id,**kwargs):
    
    #check_perm(kwargs.get('user_id'), 'edit_perm')
    _get_perm(perm_id)
    _get_role(role_id)

    try:
        roleperm_i = db.DBSession.query(RolePerm).filter(RolePerm.role_id==role_id, RolePerm.perm_id==perm_id).one()
        db.DBSession.delete(roleperm_i)
    except NoResultFound:
        raise ResourceNotFoundError("Role Perm does not exist")

    return 'OK'
1328818
def remove_roles(self, databaseName, roleNames, collectionName=None):
        
        for roleName in roleNames:
            self.remove_role(databaseName, roleName, collectionName)
432725
public function removeRole(Role $role)
    {
        $this->initializeRoles();
        if ($this->hasRole($role)) {
            $roleIdentifier = $role->getIdentifier();
            unset($this->roles[$roleIdentifier]);
            $identifierIndex = array_search($roleIdentifier, $this->roleIdentifiers);
            unset($this->roleIdentifiers[$identifierIndex]);
        }
    }
962914
static function removeTemporary()
    {
        $temporaryRoles = eZRole::fetchList( true );

        $db = eZDB::instance();
        $db->begin();
        foreach ( $temporaryRoles as $role )
        {
            $role->removeThis();
        }
        $db->commit();
    }
276688
public function removeRole(string $role): PermissionManager
    {
        if (!$this->hasRole($role)) {
            throw new RoleException("Undefined role '{$role}'");
        }

        unset($this->permissions[$role]);

        return $this;
    }
1123575
def remove_user(self, user_name, role):
        
        role_uri = self._get_role_uri(role=role)
        return self.api.delete(path=role_uri, data={'username': user_name})
874279
def delete_role(role_id)
      @roles.reject! { |r| r.id == role_id }
      @members.each do |_, member|
        new_roles = member.roles.reject { |r| r.id == role_id }
        member.update_roles(new_roles)
      end
      @channels.each do |channel|
        overwrites = channel.permission_overwrites.reject { |id, _| id == role_id }
        channel.update_overwrites(overwrites)
      end
    end
120887
def remove_role_from_user(user, role):
    
    user = _query_to_user(user)
    role = _query_to_role(role)
    if click.confirm(f'Are you sure you want to remove {role!r} from {user!r}?'):
        user.roles.remove(role)
        user_manager.save(user, commit=True)
        click.echo(f'Successfully removed {role!r} from {user!r}')
    else:
        click.echo('Cancelled.')
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;
    }
664914
def clear_roles(user):
    """"""
    roles = get_user_roles(user)

    for role in roles:
        role.remove_role_from_user(user)

    return roles
663915
def remove_one(self):
        
        self.__bulk.add_delete(self.__selector, _DELETE_ONE,
                               collation=self.__collation)
538465
public function removeRole($role)
    {
        if ($this->instance instanceof \Phavour\Session\Storage) {
            if (!$this->hasRole($role)) {
                return false;
            }
            if ($this->instance->isLocked()) {
                $this->instance->unlock();
            }
            $roles = $this->instance->get('roles');
            if (is_array($roles)) {
                $new = array();
                foreach ($roles as $old) {
                    if ($old != $role) {
                        $new[] = $old;
                    }
                }
                $this->instance->set('roles', $new);
            }

            $this->instance->lock();
            return true;
        }

        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;
    }
665685
public function removeRole($idOrName)
    {
        $ids = is_array($idOrName) ? $idOrName : func_get_args();

        foreach ($ids as $search) {
            $role = Role::search($search)->firstOrFail();

            $this->roles()->detach($role->id);
        }
    }