MCPcopy Create free account
hub / github.com/Permify/permify / UpdateRelationReferences

Method UpdateRelationReferences

pkg/dsl/ast/references.go:123–130  ·  view source on GitHub ↗

UpdateRelationReferences updates the relationship references for a given key. It replaces the existing relation types with the new ones provided. If the key is empty, it returns an error.

(key string, types []RelationTypeStatement)

Source from the content-addressed store, hash-verified

121// It replaces the existing relation types with the new ones provided.
122// If the key is empty, it returns an error.
123func (refs *References) UpdateRelationReferences(key string, types []RelationTypeStatement) error {
124 if len(key) == 0 {
125 return fmt.Errorf("key cannot be empty")
126 }
127 refs.relationReferences[key] = types // Update or set the relationship types for the key.
128 refs.references[key] = RELATION // Mark this key as a relation reference.
129 return nil
130}
131
132// UpdatePermissionReference updates the permission references for a given key.
133// This typically means marking a particular entity or action as permitted.

Callers 1

UpdateStatementMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected