mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #43375 from CaoShuFeng/forbiddenMessage
Automatic merge from submit-queue Fix empty RBAC Forbidden message Fix empty RBAC Forbidden message when accessing cluster scope resources. **Release note**: ```NONE ```
This commit is contained in:
commit
6d7e6c74c9
@ -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