Remove a permission from a team.
514342
def destroy(
            self, request, pk=None, parent_lookup_seedteam=None,
            parent_lookup_seedteam__organization=None):
        ''''''
        self.check_team_permissions(
            request, parent_lookup_seedteam,
            parent_lookup_seedteam__organization)
        return super(TeamPermissionViewSet, self).destroy(
            request, pk, parent_lookup_seedteam,
            parent_lookup_seedteam__organization)
980252
def remove_user_permission(rid, uid, action='full'):
    
    rid = rid.replace('/', '%252F')

    try:
        acl_url = urljoin(_acl_url(), 'acls/{}/users/{}/{}'.format(rid, uid, action))
        r = http.delete(acl_url)
        assert r.status_code == 204
    except DCOSHTTPException as e:
        if e.response.status_code != 400:
            raise
467208
def revoke_permission(user, permission_name):
    
    roles = get_user_roles(user)

    for role in roles:
        if permission_name in role.permission_names_list():
            permission = get_permission(permission_name)
            user.user_permissions.remove(permission)
            return

    raise RolePermissionScopeException(
        "This permission isn't in the scope of "
        "any of this user's roles.")
242153
function deleteTeam (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      db.withTransaction([
        (job, next) => {
          const { id, organizationId } = params

          Joi.validate({ id, organizationId }, validationRules.deleteTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.teamId = params.id
          job.organizationId = params.organizationId
          next()
        },
        loadTeamDescendants,
        deleteTeamsMembers,
        deleteTeamsPolicies,
        readDefaultPoliciesIds,
        deleteDefaultPolicies,
        removeTeams
      ], (err) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
176107
async def revoke(self):
        
        await self.controller.revoke(self.username)
        self._user_info.access = ''
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)
585786
public function down()
    {
        Schema::table(\Config::get( 'teamwork.users_table' ), function(Blueprint $table)
        {
            $table->dropColumn('current_team_id');
        });

        Schema::table(\Config::get('teamwork.team_user_table'), function (Blueprint $table) {
            $table->dropForeign(\Config::get('teamwork.team_user_table').'_user_id_foreign');
            $table->dropForeign(\Config::get('teamwork.team_user_table').'_team_id_foreign');
        });

        Schema::drop(\Config::get('teamwork.team_user_table'));
        Schema::drop(\Config::get('teamwork.team_invites_table'));
        Schema::drop(\Config::get('teamwork.teams_table'));

    }
1311859
def remove(self, *members):
        
        members = list(map(self._dumps, members))
        self._client.zrem(self.key_prefix, *members)
549209
def _remove_rule(self, group, role, value=None):
        """"""
        if role not in group:
            return

        if value is None:
            group.pop(role, None)
        else:
            group[role].remove(value)

        self.invalidate()
211365
def disconnect(service_instance):
    '''
    
    '''
    log.trace('Disconnecting')
    try:
        Disconnect(service_instance)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
816389
def remove():
    
    if exists(env.venv_path):
        run("rm -rf %s" % env.venv_path)
    if exists(env.proj_path):
        run("rm -rf %s" % env.proj_path)
    for template in get_templates().values():
        remote_path = template["remote_path"]
        if exists(remote_path):
            sudo("rm %s" % remote_path)
    if exists(env.repo_path):
        run("rm -rf %s" % env.repo_path)
    sudo("supervisorctl update")
    psql("DROP DATABASE IF EXISTS %s;" % env.proj_name)
    psql("DROP USER IF EXISTS %s;" % env.proj_name)
1314402
def remove_member_from_group(self, group_id, user_id):
        
        url = self.TEAM_MEMBERS_URL % (group_id, user_id)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.delete_request()
1310118
def remove_peer_from_group(self, group_jid, peer_jid):
        
        log.info("[+] Requesting removal of user {} from group {}".format(peer_jid, group_jid))
        return self._send_xmpp_element(group_adminship.RemoveFromGroupRequest(group_jid, peer_jid))
481393
def del_permission_role(self, role, perm_view):
        
        if perm_view in role.permissions:
            try:
                role.permissions.remove(perm_view)
                self.get_session.merge(role)
                self.get_session.commit()
                log.info(
                    c.LOGMSG_INF_SEC_DEL_PERMROLE.format(str(perm_view), role.name)
                )
            except Exception as e:
                log.error(c.LOGMSG_ERR_SEC_DEL_PERMROLE.format(str(e)))
                self.get_session.rollback()
527741
function removeTeam($competitionId, $teamId)
	{
		if(!$competitionId)
		{
			throw new Exception('Invalid competitionId');
		}
		if(!$teamId)
		{
			throw new Exception('Invalid teamId');
		}

		return $this->execute('DELETE', '/competitions/%d/teams/%d/', array($competitionId, $teamId));
	}
1018484
def remove_package(self, team, user, package):
        
        self.check_name(team, user, package)

        path = self.package_path(team, user, package)
        remove_objs = set()
        # TODO: do we really want to delete invisible dirs?
        if os.path.isdir(path):
            # Collect objects from all instances for potential cleanup
            contents_path = os.path.join(path, PackageStore.CONTENTS_DIR)
            for instance in os.listdir(contents_path):
                pkg = self.get_package(team, user, package, pkghash=instance)
                remove_objs.update(find_object_hashes(pkg))
            # Remove package manifests
            rmtree(path)

        return self.prune(remove_objs)
1331924
def clean_perms(self):
        """"""
        logging.info('Cleaning faulty perms')
        sesh = self.get_session
        pvms = (
            sesh.query(ab_models.PermissionView)
            .filter(or_(
                ab_models.PermissionView.permission == None,  # NOQA
                ab_models.PermissionView.view_menu == None,  # NOQA
            ))
        )
        deleted_count = pvms.delete()
        sesh.commit()
        if deleted_count:
            logging.info('Deleted {} faulty permissions'.format(deleted_count))