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

Function AreQueryAndSubjectEqual

pkg/tuple/tuple.go:45–47  ·  view source on GitHub ↗

AreQueryAndSubjectEqual checks if a query and a subject are equal

(en *base.Entity, permission string, s2 *base.Subject)

Source from the content-addressed store, hash-verified

43
44// AreQueryAndSubjectEqual checks if a query and a subject are equal
45func AreQueryAndSubjectEqual(en *base.Entity, permission string, s2 *base.Subject) bool {
46 return NormalizeRelation(permission) == NormalizeRelation(s2.GetRelation()) && en.GetId() == s2.GetId() && en.GetType() == s2.GetType()
47}
48
49// EAREqual checks if two subjects are equal
50func EAREqual(s1, s2 *base.EntityAndRelation) bool {

Callers 1

checkMethod · 0.92

Calls 4

NormalizeRelationFunction · 0.85
GetTypeMethod · 0.65
GetRelationMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected