removePolicy removes a policy rule from the storage.
171580
@Override
    public void removePolicy(String sec, String ptype, List<String> rule) {
        throw new Error("not implemented");
    }
635723
@Override
    public boolean deletePolicy(String name) throws PolicyIndexException {
        log.debug("Deleting document: " + name);

        DbXmlManager.writeLock.lock();
        try {
            m_dbXmlManager.container.deleteDocument(name, m_dbXmlManager.updateContext);
            setLastUpdate(System.currentTimeMillis());
        } catch (XmlException xe) {
            // safe delete - only warn if not found
            if (xe.getDbError() == XmlException.DOCUMENT_NOT_FOUND){
                log.warn("Error deleting document: " + name + " - document does not exist");
            } else {
                throw new PolicyIndexException("Error deleting document: " + name + xe.getMessage(), xe);
            }
        } finally {
            DbXmlManager.writeLock.unlock();
        }
        return true;
    }
521518
def policy_definition_delete(name, **kwargs):
    '''
    

    '''
    result = False
    polconn = __utils__['azurearm.get_client']('policy', **kwargs)
    try:
        # pylint: disable=unused-variable
        policy = polconn.policy_definitions.delete(
            policy_definition_name=name
        )
        result = True
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)

    return result
73985
def _clear_policy(self, lambda_name):
        
        try:
            policy_response = self.lambda_client.get_policy(
                FunctionName=lambda_name
            )
            if policy_response['ResponseMetadata']['HTTPStatusCode'] == 200:
                statement = json.loads(policy_response['Policy'])['Statement']
                for s in statement:
                    delete_response = self.lambda_client.remove_permission(
                        FunctionName=lambda_name,
                        StatementId=s['Sid']
                    )
                    if delete_response['ResponseMetadata']['HTTPStatusCode'] != 204:
                        logger.error('Failed to delete an obsolete policy statement: {}'.format(policy_response))
            else:
                logger.debug('Failed to load Lambda function policy: {}'.format(policy_response))
        except ClientError as e:
            if e.args[0].find('ResourceNotFoundException') > -1:
                logger.debug('No policy found, must be first run.')
            else:
                logger.error('Unexpected client error {}'.format(e.args[0]))
1350457
def _RemoveForemanRule(self):
    """"""
    if data_store.RelationalDBEnabled():
      data_store.REL_DB.RemoveForemanRule(hunt_id=self.session_id.Basename())
      return

    with aff4.FACTORY.Open(
        "aff4:/foreman", mode="rw", token=self.token) as foreman:
      aff4_rules = foreman.Get(foreman.Schema.RULES)
      aff4_rules = foreman.Schema.RULES(
          # Remove those rules which fire off this hunt id.
          [r for r in aff4_rules if r.hunt_id != self.session_id])
      foreman.Set(aff4_rules)
197949
public void removeRule( RuleWrapper remRule ) {
        Rule rule = remRule.getRule();
        featureTypeStyle.rules().remove(rule);
        rulesWrapperList.remove(remRule);
    }
441542
func (a *AdapterMock) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error {
	return a.GetMockErr()
}
832736
func (model Model) RemovePolicy(sec string, ptype string, rule []string) bool {
	for i, r := range model[sec][ptype].Policy {
		if util.ArrayEquals(rule, r) {
			model[sec][ptype].Policy = append(model[sec][ptype].Policy[:i], model[sec][ptype].Policy[i+1:]...)
			return true
		}
	}

	return false
}
958857
public function removeDeliveryPolicyFromAsset($asset, $policy)
    {
        $assetId = Utilities::getEntityId(
            $asset,
            'WindowsAzure\MediaServices\Models\Asset'
        );

        $policyId = Utilities::getEntityId(
            $policy,
            'WindowsAzure\MediaServices\Models\AssetDeliveryPolicy'
        );

        $method = Resources::HTTP_DELETE;
        $path = "Assets('{$assetId}')/\$links/DeliveryPolicies('{$policyId}')";
        $headers = [];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_NO_CONTENT;

        $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode
        );
    }
662176
func (e *Enforcer) removePolicy(sec string, ptype string, rule []string) bool {
	ruleRemoved := e.model.RemovePolicy(sec, ptype, rule)
	if !ruleRemoved {
		return ruleRemoved
	}

	if e.adapter != nil && e.autoSave {
		if err := e.adapter.RemovePolicy(sec, ptype, rule); err != nil {
			if err.Error() != notImplemented {
				panic(err)
			}
		}
		if e.watcher != nil {
			// error intentionally ignored
			e.watcher.Update()
		}
	}

	return ruleRemoved
}
1140794
public function removePolicy($policyId)
    {
        try {
            return $this->innerGateway->removePolicy($policyId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1000176
def remove_rule_entry(self, rule_info):
        """"""

        temp_list = list(self.rule_info)
        for rule in temp_list:
            if (rule.ip == rule_info.get('ip') and
                rule.mac == rule_info.get('mac') and
                    rule.port == rule_info.get('port')):
                LOG.debug('Removed rule info %s from the list', rule_info)
                self.rule_info.remove(rule)
751815
func (model Model) ClearPolicy() {
	for _, ast := range model["p"] {
		ast.Policy = nil
	}

	for _, ast := range model["g"] {
		ast.Policy = nil
	}
}
1311086
function deletePolicy (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, organizationId } = params
      const tasks = [
        (job, next) => {
          Joi.validate({ id, organizationId }, validationRules.deletePolicy, (err) => {
            if (err) return next(Boom.badRequest(err))

            next()
          })
        },
        (job, next) => {
          job.id = id
          job.organizationId = organizationId
          next()
        },
        removePolicyFromUsers,
        removePolicyFromTeams,
        removePolicyFromOrganizations,
        removePolicy
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
1315642
func (e *Enforcer) RemoveFilteredGroupingPolicy(fieldIndex int, fieldValues ...string) bool {
	return e.RemoveFilteredNamedGroupingPolicy("g", fieldIndex, fieldValues...)
}
980062
public boolean removeNamedGroupingPolicy(String ptype, List<String> params) {
        boolean ruleRemoved = removePolicy("g", ptype, params);

        if (autoBuildRoleLinks) {
            buildRoleLinks();
        }
        return ruleRemoved;
    }
922595
def delete(self, port, qos_policy=None):
        
        LOG.info("Deleting QoS policy %(qos_policy)s on port %(port)s",
                 dict(qos_policy=qos_policy, port=port))

        self._utils.remove_port_qos_rule(port["port_id"])