mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
Fix empty RBAC Forbidden message
This commit is contained in:
parent
b983cc76e1
commit
30844541d5
@ -52,6 +52,10 @@ func forbiddenMessage(attributes authorizer.Attributes) string {
|
|||||||
username = user.GetName()
|
username = user.GetName()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !attributes.IsResourceRequest() {
|
||||||
|
return fmt.Sprintf("User %q cannot %s path %q.", username, attributes.GetVerb(), attributes.GetPath())
|
||||||
|
}
|
||||||
|
|
||||||
resource := attributes.GetResource()
|
resource := attributes.GetResource()
|
||||||
if group := attributes.GetAPIGroup(); len(group) > 0 {
|
if group := attributes.GetAPIGroup(); len(group) > 0 {
|
||||||
resource = resource + "." + group
|
resource = resource + "." + group
|
||||||
|
Loading…
Reference in New Issue
Block a user