MCPcopy
hub / github.com/seaweedfs/seaweedfs / UpdatePolicy

Method UpdatePolicy

weed/credential/credential_manager.go:265–272  ·  view source on GitHub ↗

UpdatePolicy updates an existing policy (if supported by the store)

(ctx context.Context, name string, document policy_engine.PolicyDocument)

Source from the content-addressed store, hash-verified

263
264// UpdatePolicy updates an existing policy (if supported by the store)
265func (cm *CredentialManager) UpdatePolicy(ctx context.Context, name string, document policy_engine.PolicyDocument) error {
266 // Check if the store implements PolicyManager interface with UpdatePolicy
267 if policyStore, ok := cm.Store.(PolicyManager); ok {
268 return policyStore.UpdatePolicy(ctx, name, document)
269 }
270 // Fallback to PutPolicy for stores that only implement CredentialStore
271 return cm.Store.PutPolicy(ctx, name, document)
272}
273
274// PutUserInlinePolicy stores a per-user inline policy document.
275// Returns nil without error if the underlying store does not support inline policies.

Callers

nothing calls this directly

Calls 2

UpdatePolicyMethod · 0.65
PutPolicyMethod · 0.65

Tested by

no test coverage detected