Removes a set of specified permissions from the server group specified with $sgid. Multiple
permissions can be removed at once.

@param  integer $sgid
@param  integer $permid
@return void
515127
public function serverGroupPermRemove($sgid, $permid)
  {
    if(!is_array($permid))
    {
      $permident = (is_numeric($permid)) ? "permid" : "permsid";
    }
    else
    {
      $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
    }

    $this->execute("servergroupdelperm", array("sgid" => $sgid, $permident => $permid));
  }
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'
547081
public function deletePermissions(array $ids): void
	{
		if ($this->isAjax()) {
			$permissions = $this->orm->acl->findById($ids);
			foreach ($permissions as $permission) {
				$this->orm->acl->remove($permission);
			}
			$this->orm->flush();
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
531812
def del_permission_role(self, role, perm_view):
        
        if perm_view in role.permissions:
            try:
                role.permissions.remove(perm_view)
                role.save()
                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)))
177339
public function removePermissions(DataObject $node, $perm, DataObject $userOrGroup, $grant = 'GRANT')
    {
        if (!$this->checkPerm($node, 'ChangePermissions')) {
            throw new PermissionDeniedException("You do not have permission to do that");
        }

        $composedOf = $perm;
        if (!is_array($perm)) {
            $role = DataObject::get_one('AccessRole', '"Title" = \'' . Convert::raw2sql($perm) . '\'');
            $composedOf = array($perm);
            if ($role && $role->exists()) {
                $composedOf = $role->Composes->getValues();
            }
        }
        
        $type = $userOrGroup instanceof Member ? 'Member' : get_class($userOrGroup);
        $filter = array(
            'Type' => $type,
            'AuthorityID' => $userOrGroup->ID,
            'ItemID' => $node->ID,
            'ItemType' => $node->class,
            'Grant' => $grant,
        );

        $existing = DataList::create('AccessAuthority')->filter($filter)->first();
        
        if (!$existing || !$existing->exists()) {
            return;
        }

        $current = $existing->Perms->getValues();
        if (is_array($current) && count($current)) {
            $new = array_diff($current, $composedOf);
            $existing->Perms = $new;
            $existing->write();
            
            $this->clearPermCacheFor($node);
            
            if (!count($new)) {
                try {
                    $this->removeAuthority($node, $existing);
                } catch (Exception $e) {
                    // oh well
                }
            }
        }
    }
295899
public function deleteGroup($groupId)
    {
        $objectStates = $this->loadObjectStates($groupId);
        foreach ($objectStates as $objectState) {
            $this->objectStateGateway->deleteObjectStateLinks($objectState->id);
            $this->objectStateGateway->deleteObjectState($objectState->id);
        }

        $this->objectStateGateway->deleteObjectStateGroup($groupId);
    }
457766
public function Clear($UserID = '') {
      if (empty($_POST))
         throw PermissionException('Javascript');
      
      $UserID = is_numeric($UserID) ? $UserID : 0;
      $Session = Gdn::Session();
      if ($UserID != $Session->UserID && !$Session->CheckPermission('Garden.Moderation.Manage'))
         throw PermissionException('Garden.Moderation.Manage');

      if ($UserID > 0)
         $this->UserModel->SaveAbout($UserID, '');

      if ($this->DeliveryType() == DELIVERY_TYPE_ALL)
         Redirect('/profile');
      else {
         $this->JsonTarget('#Status', '', 'Remove');
         $this->Render('Blank', 'Utility');
      }
   }
1085755
def remove_permission(self, file_id, permission_id):
        
        url = '{0}/{1}/permissions/{2}'.format(
            DRIVE_FILES_API_V2_URL,
            file_id,
            permission_id
        )

        self.request('delete', url)
397284
public function grantFullAccess($perfilId)
    {
        if (!$this->checkPerfilExists($perfilId)) {
            throw new \Exception(sprintf('O Perfil informado não existe!'));
        }

        // recupera a relação de todos os componentes
        $components = $this->getComponents();

        // apaga os registros de permissão do perfil
        $this->clearPermissions($perfilId);

        foreach ($components as $component) {
            $this->grantAccess($perfilId, $component['id']);
        }
    }
739275
public function deny($requester, $controlled, $perms = "*") {
		$permission = $this->_classes['permission'];
		return $permission::allow($requester, $controlled, $perms, -1);
	}
271335
def delete_perm(perm_id,**kwargs):
    

    #check_perm(kwargs.get('user_id'), 'edit_perm')
    try:
        perm_i = db.DBSession.query(Perm).filter(Perm.id==perm_id).one()
        db.DBSession.delete(perm_i)
    except InvalidRequestError:
        raise ResourceNotFoundError("Permission (id=%s) does not exist"%(perm_id))

    return 'OK'
161137
public function clientPermAssign($cldbid, $permid, $permvalue)
  {
    $this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
  }
1350238
public function disablePermissionManager(AbstractEditableSecurityEvent $event): void
    {
        $event->setPermissionEnabled($this->permManager->isEnabled());
        $this->permManager->setEnabled(false);
    }
253748
public function removeRolePermission(Role $role, Permission $permission)
    {
        // Remove permissions which match the action and resource
        $this->permissions[$this->getRoleKey($role)] = array_filter(
            $this->getRolePermissions($role),
            function (Permission $rolePermission) use ($permission) {
                // Only keep permissions which don't exactly match the one which we're trying to remove.
                return ! $rolePermission->matchesPermission($permission);
            }
        );
    }
98295
public function deletePermissions($resourceId)
    {
        $rules = $this->aclDataService->getRulesByResource($resourceId)
            ->getData();
        /** @var \RcmUser\Acl\Entity\AclRole $role */
        foreach ($rules as $rule) {
            $result = $this->aclDataService->deleteRule($rule);

            if (!$result->isSuccess()) {
                return false;
            }
        }

        return true;
    }
773265
def remove_permission(payload, permission):
    """"""
    payload = copy.deepcopy(payload)

    for entity_type in ['users', 'groups']:
        for perm_type in ['add', 'remove']:
            for perms in payload.get(entity_type, {}).get(perm_type, {}).values():
                if permission in perms:
                    perms.remove(permission)

    for perm_type in ['add', 'remove']:
        perms = payload.get('public', {}).get(perm_type, [])
        if permission in perms:
            perms.remove(permission)

    return payload
1310001
public function prune($rolePermission = null)
    {
        if ($rolePermission) {
            $this->addCond('pruneCond0', $this->getAliasedColName(RolePermissionTableMap::COL_ROLE_ID), $rolePermission->getRoleId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(RolePermissionTableMap::COL_PERMISSION_ID), $rolePermission->getPermissionId(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }