add subresource to forbidden message

This commit is contained in:
deads2k 2017-01-10 12:36:17 -05:00
parent 6f320061f5
commit c49639c53c

View File

@ -56,6 +56,9 @@ func forbiddenMessage(attributes authorizer.Attributes) string {
if group := attributes.GetAPIGroup(); len(group) > 0 {
resource = resource + "." + group
}
if subresource := attributes.GetSubresource(); len(subresource) > 0 {
resource = resource + "/" + subresource
}
if ns := attributes.GetNamespace(); len(ns) > 0 {
return fmt.Sprintf("User %q cannot %s %s in the namespace %q.", username, attributes.GetVerb(), resource, ns)