(err error)
| 131 | } |
| 132 | |
| 133 | func IsUnauthorizedError(err error) bool { |
| 134 | if err == nil { |
| 135 | return false |
| 136 | } |
| 137 | |
| 138 | // This tests for dbauthz.IsNotAuthorizedError and rbac.IsUnauthorizedError. |
| 139 | var unauthorized httpapiconstraints.IsUnauthorizedError |
| 140 | if errors.As(err, &unauthorized) && unauthorized.IsUnauthorized() { |
| 141 | return true |
| 142 | } |
| 143 | return false |
| 144 | } |
| 145 | |
| 146 | // Convenience error functions don't take contexts since their responses are |
| 147 | // static, it doesn't make much sense to trace them. |
no test coverage detected