// ClearPolicy clears all policy.
965245
func (e *SyncedEnforcer) ClearPolicy() {
	e.m.Lock()
	defer e.m.Unlock()
	e.Enforcer.ClearPolicy()
}
371433
func (s *Bucket) DeletePolicy() (*DeleteBucketPolicyOutput, error) {
	r, x, err := s.DeletePolicyRequest()

	if err != nil {
		return x, err
	}

	err = r.Send()
	if err != nil {
		return nil, err
	}

	requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
	x.RequestID = &requestID

	return x, err
}
811177
func SimplifyPolicy(pol *tree.Policy) {
	for _, r := range pol.Rules {
		r.Body = Simplify(r.Body)
	}
}
1094897
func hookHasDeletePolicy(h *release.Hook, policy string) bool {
	if dp, ok := deletePolices[policy]; ok {
		for _, v := range h.DeletePolicies {
			if dp == v {
				return true
			}
		}
	}
	return false
}
383921
func (ipt *IPTables) ChangePolicy(table, chain, target string) error {
	return ipt.run("-t", table, "-P", chain, target)
}
401996
func (ps *PolicyStore) SetPolicy(ctx context.Context, p *Policy) error {
	defer metrics.MeasureSince([]string{"policy", "set_policy"}, time.Now())
	if p == nil {
		return fmt.Errorf("nil policy passed in for storage")
	}
	if p.Name == "" {
		return fmt.Errorf("policy name missing")
	}
	// Policies are normalized to lower-case
	p.Name = ps.sanitizeName(p.Name)
	if strutil.StrListContains(immutablePolicies, p.Name) {
		return fmt.Errorf("cannot update %q policy", p.Name)
	}

	return ps.setPolicyInternal(ctx, p)
}
604070
func (s *GetContainerPolicyOutput) SetPolicy(v string) *GetContainerPolicyOutput {
	s.Policy = &v
	return s
}
991044
func (e *Enforcer) RemoveFilteredPolicy(fieldIndex int, fieldValues ...string) bool {
	return e.RemoveFilteredNamedPolicy("p", fieldIndex, fieldValues...)
}
24362
func (s *GetDataRetrievalPolicyOutput) SetPolicy(v *DataRetrievalPolicy) *GetDataRetrievalPolicyOutput {
	s.Policy = v
	return s
}
372093
func (s *CreateRestApiInput) SetPolicy(v string) *CreateRestApiInput {
	s.Policy = &v
	return s
}
698539
func (s *TestInvokeAuthorizerOutput) SetPolicy(v string) *TestInvokeAuthorizerOutput {
	s.Policy = &v
	return s
}
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
}
920870
func (api *API) AccessPolicy(zoneID, applicationID, policyID string) (AccessPolicy, error) {
	uri := fmt.Sprintf(
		"/zones/%s/access/apps/%s/policies/%s",
		zoneID,
		applicationID,
		policyID,
	)

	res, err := api.makeRequest("GET", uri, nil)
	if err != nil {
		return AccessPolicy{}, errors.Wrap(err, errMakeRequestError)
	}

	var accessPolicyDetailResponse AccessPolicyDetailResponse
	err = json.Unmarshal(res, &accessPolicyDetailResponse)
	if err != nil {
		return AccessPolicy{}, errors.Wrap(err, errUnmarshalError)
	}

	return accessPolicyDetailResponse.Result, nil
}
345987
func (s *PutPermissionPolicyInput) SetPolicy(v string) *PutPermissionPolicyInput {
	s.Policy = &v
	return s
}
956561
func (s *DescribedUser) SetPolicy(v string) *DescribedUser {
	s.Policy = &v
	return s
}
1125974
func (s *PutContainerPolicyInput) SetPolicy(v string) *PutContainerPolicyInput {
	s.Policy = &v
	return s
}
1363158
func (network *HostComputeNetwork) RemovePolicy(networkPolicy PolicyNetworkRequest) error {
	logrus.Debugf("hcn::HostComputeNetwork::RemovePolicy id=%s", network.Id)

	settingsJson, err := json.Marshal(networkPolicy)
	if err != nil {
		return err
	}
	requestMessage := &ModifyNetworkSettingRequest{
		ResourceType: NetworkResourceTypePolicy,
		RequestType:  RequestTypeRemove,
		Settings:     settingsJson,
	}

	return network.ModifyNetworkSettings(requestMessage)
}