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

Function EAREqual

pkg/tuple/tuple.go:50–52  ·  view source on GitHub ↗

EAREqual checks if two subjects are equal

(s1, s2 *base.EntityAndRelation)

Source from the content-addressed store, hash-verified

48
49// EAREqual checks if two subjects are equal
50func EAREqual(s1, s2 *base.EntityAndRelation) bool {
51 return s1.GetRelation() == s2.GetRelation() && s1.GetEntity().GetId() == s2.GetEntity().GetId() && s1.GetEntity().GetType() == s2.GetEntity().GetType()
52}
53
54// SubjectToEAR converts a Subject object to an EntityAndRelation object
55func SubjectToEAR(subject *base.Subject) *base.EntityAndRelation {

Callers 1

tuple_test.goFile · 0.85

Calls 4

GetTypeMethod · 0.65
GetRelationMethod · 0.45
GetIdMethod · 0.45
GetEntityMethod · 0.45

Tested by

no test coverage detected