MCPcopy Index your code
hub / github.com/coder/coder / Equal

Method Equal

coderd/rbac/authz.go:142–159  ·  view source on GitHub ↗
(b Subject)

Source from the content-addressed store, hash-verified

140}
141
142func (s Subject) Equal(b Subject) bool {
143 if s.ID != b.ID {
144 return false
145 }
146
147 if !slice.SameElements(s.Groups, b.Groups) {
148 return false
149 }
150
151 if !slice.SameElements(s.SafeRoleNames(), b.SafeRoleNames()) {
152 return false
153 }
154
155 if s.SafeScopeName() != b.SafeScopeName() {
156 return false
157 }
158 return true
159}
160
161// SafeScopeName prevent nil pointer dereference.
162func (s Subject) SafeScopeName() string {

Callers

nothing calls this directly

Calls 3

SafeRoleNamesMethod · 0.95
SafeScopeNameMethod · 0.95
SameElementsFunction · 0.92

Tested by

no test coverage detected