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

Function IsUnauthorizedError

coderd/rbac/error.go:49–51  ·  view source on GitHub ↗

IsUnauthorizedError is a convenience function to check if err is UnauthorizedError. It is equivalent to errors.As(err, &UnauthorizedError{}).

(err error)

Source from the content-addressed store, hash-verified

47// IsUnauthorizedError is a convenience function to check if err is UnauthorizedError.
48// It is equivalent to errors.As(err, &UnauthorizedError{}).
49func IsUnauthorizedError(err error) bool {
50 return errors.As(err, &UnauthorizedError{})
51}
52
53// ForbiddenWithInternal creates a new error that will return a simple
54// "forbidden" to the client, logging internally the more detailed message

Callers 8

assertRBACNoLockMethod · 0.92
TestCacheRBACFunction · 0.92
NewOptionsFunction · 0.92
TestIsUnauthorizedErrorFunction · 0.92
buildTxMethod · 0.92
putPrebuildsSettingsMethod · 0.92
FilterFunction · 0.70

Calls 1

AsMethod · 0.80

Tested by 2

TestCacheRBACFunction · 0.74
TestIsUnauthorizedErrorFunction · 0.74