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

Function Reference

pkg/schema/builder.go:165–180  ·  view source on GitHub ↗

Reference - Reference builder

(name string)

Source from the content-addressed store, hash-verified

163
164// Reference - Reference builder
165func Reference(name string) *base.RelationReference {
166 // Split the name parameter into a type and relation if it contains a "#"
167 s := strings.Split(name, "#")
168 if len(s) == 1 {
169 // If no relation is specified in the name, return a RelationReference with an empty relation field
170 return &base.RelationReference{
171 Type: s[0],
172 Relation: "",
173 }
174 }
175 // If a relation is specified in the name, return a RelationReference with both type and relation fields populated
176 return &base.RelationReference{
177 Type: s[0],
178 Relation: s[1],
179 }
180}
181
182// Permission - Permission builder creates a new action definition with the given name and child entity
183func Permission(name string, child *base.Child) *base.PermissionDefinition {

Callers 1

builder_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected