MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / IsAdmin

Method IsAdmin

pkg/identityserver/entity_access.go:429–435  ·  view source on GitHub ↗

IsAdmin returns whether the caller is an admin.

(ctx context.Context)

Source from the content-addressed store, hash-verified

427
428// IsAdmin returns whether the caller is an admin.
429func (is *IdentityServer) IsAdmin(ctx context.Context) bool {
430 authInfo, err := is.authInfo(ctx)
431 if err != nil {
432 return false
433 }
434 return authInfo.IsAdmin
435}
436
437// RequireAdmin returns an error when the caller is not an admin.
438func (is *IdentityServer) RequireAdmin(ctx context.Context) error {

Callers 15

ApplicationRightsMethod · 0.95
ClientRightsMethod · 0.95
GatewayRightsMethod · 0.95
OrganizationRightsMethod · 0.95
UserRightsMethod · 0.95
createUserMethod · 0.95
updateUserMethod · 0.95
purgeUserMethod · 0.95
createGatewayMethod · 0.95
purgeGatewayMethod · 0.95
createApplicationMethod · 0.95
purgeApplicationMethod · 0.95

Implementers 5

mockInteroppkg/component/interop_test.go
interopServerpkg/joinserver/http_interop.go
noopServerpkg/interop/server.go
mockTargetpkg/interop/server_test.go
interopServerpkg/identityserver/http_interop.go

Calls 1

authInfoMethod · 0.95

Tested by

no test coverage detected