SafeRoleNames prevent nil pointer dereference.
()
| 168 | |
| 169 | // SafeRoleNames prevent nil pointer dereference. |
| 170 | func (s Subject) SafeRoleNames() []RoleIdentifier { |
| 171 | if s.Roles == nil { |
| 172 | return []RoleIdentifier{} |
| 173 | } |
| 174 | return s.Roles.Names() |
| 175 | } |
| 176 | |
| 177 | // HasOrganizationMembership reports whether the subject has explicit |
| 178 | // membership in organizationID through an org-scoped role. Site-wide roles |
no test coverage detected