dismember user from a group
325305
def del_membership(self, user, role):
        
        if not self.has_membership(user, role):
            return True
        targetRecord = AuthMembership.objects(creator=self.client, user=user).first()
        if not targetRecord:
            return True
        for group in targetRecord.groups:
            if group.role==role:
                targetRecord.groups.remove(group)
        targetRecord.save()
        return True
889763
def group_memberships_destroy_many(self, ids=None, **kwargs):
        ""
        api_path = "/api/v2/group_memberships/destroy_many.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if ids:
            api_query.update({
                "ids": ids,
            })
        return self.call(api_path, query=api_query, method="DELETE", **kwargs)
488481
def kick(user, reason = nil)
      API::Server.remove_member(@bot.token, @id, user.resolve_id, reason)
    end
215475
def disconnect_user(self):
        
        if self.session_logged_in():
            self._logger.info("User %s disconnected - %s - %s - %s", self.session_username(), self.session_realname(), self.session_email(), web.ctx.ip)
        self._destroy_session()
1123008
def delete(config, group, force):
        """"""
        if not force:
            if not click.confirm(
                    'Confirm that you want to delete group {}'.format(group)):
                sys.exit("Deletion of {} aborted".format(group))

        client = Client()
        client.prepare_connection()
        group_api = API(client)
        group_api.delete(group)
780072
function (thing, group) {
            var pname = kb.any(thing, ns.vcard('fn'))
            var gname = kb.any(group, ns.vcard('fn'))
            var groups = kb.each(null, ns.vcard('hasMember'), thing)
            if (groups.length < 2) {
              alert('Must be a member of at least one group.  Add to another group first.')
              return
            }
            var message = 'Remove ' + pname + ' from group ' + gname + '?'
            if (confirm(message)) {
              var del = [ $rdf.st(group, ns.vcard('hasMember'), thing, group.doc()),
                $rdf.st(thing, ns.vcard('fn'), pname, group.doc())]
              kb.updater.update(del, [], function (uri, ok, err) {
                if (!ok) return complain('Error removing member from group ' + group + ': ' + err)
                console.log('Removed ' + pname + ' from group ' + gname)
                syncGroupList()
              })
            }
          }
1073375
def remove_user(self, user, **kwargs):
        """"""
        if isinstance(user, Entity):
            user = user['id']

        assert isinstance(user, six.string_types)

        endpoint = '{0}/{1}/users/{2}'.format(
            self.endpoint,
            self['id'],
            user,
        )
        return self.request('DELETE', endpoint=endpoint, query_params=kwargs)
218023
def remove_user_from_group(self, username, groupname):
        
        url = self._options['server'] + '/rest/api/latest/group/user'
        x = {'groupname': groupname,
             'username': username}

        self._session.delete(url, params=x)

        return True
1277908
def remove_user(self, user):
        
        org_user = self._org_user_model.objects.get(user=user, organization=self)
        org_user.delete()

        # User removed signal
        user_removed.send(sender=self, user=user)
51516
public function unsetUserGroups()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sDelete = 'delete from oxobject2group where oxobjectid = ' . $oDb->quote($this->getId());
        $oDb->execute($sDelete);
    }
607599
def remove_from_group(self, devices):
        """"""
        ids = {d.id for d in self.devices_in_group()}
        ids.difference_update(self._device_ids(devices))
        self._set_group(ids)
27012
def del_group(self):
        """"""
        idx = self.tabs.currentIndex()
        self.tabs.removeTab(idx)

        self.apply()
241306
def deluser(name, username):
    '''
    
    '''
    grp_info = __salt__['group.info'](name)

    if username not in grp_info['members']:
        return True

    # Note: pw exits with code 65 if group is unknown
    retcode = __salt__['cmd.retcode']('pw groupmod {0} -d {1}'.format(
        name, username), python_shell=False)

    return not retcode
18730
def org_remove_member(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/removeMember' % object_id, input_params, always_retry=always_retry, **kwargs)
941472
def DeleteGRRUser(self, username, cursor=None):
    """"""
    cursor.execute("DELETE FROM grr_users WHERE username_hash = %s",
                   (mysql_utils.Hash(username),))

    if cursor.rowcount == 0:
      raise db.UnknownGRRUserError(username)
219714
def remove_perm(perm, user_or_group, forum=None):
    
    user, group = get_identity(user_or_group)
    perm = ForumPermission.objects.get(codename=perm)
    if user:
        UserForumPermission.objects.filter(
            forum=forum,
            permission=perm,
            user=user if not user.is_anonymous else None,
            anonymous_user=user.is_anonymous,
        ).delete()
    if group:
        GroupForumPermission.objects.filter(forum=forum, permission=perm, group=group).delete()
211036
def delete_by_user_name(user_name):
        '''
        
        '''
        try:
            del_count = TabMember.delete().where(TabMember.user_name == user_name)
            del_count.execute()
            return True
        except:
            return False