1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-18 16:35:19 +00:00

Merge pull request #322 from rmweir/add-unauth-check-2.4

[Forwardport] 2.4: Add unauthorized error check
This commit is contained in:
Dan Ramich
2019-11-18 08:49:00 -08:00
committed by GitHub

View File

@@ -120,3 +120,10 @@ func IsConflict(err error) bool {
return false
}
func IsForbidden(err error) bool {
if apiError, ok := err.(*APIError); ok {
return apiError.Code.Status == 403
}
return false
}