mirror of
https://github.com/rancher/steve.git
synced 2025-09-18 00:08:17 +00:00
* Show patch link on the API resource when patch permission is present and add patch ResourceMethod to the schema.
This commit is contained in:
@@ -103,6 +103,10 @@ func formatter(summarycache *summarycache.SummaryCache) types.Formatter {
|
||||
resource.Links["remove"] = "blocked"
|
||||
}
|
||||
|
||||
if _, ok := resource.Links["patch"]; !ok && slice.ContainsString(resource.Schema.ResourceMethods, "blocked-PATCH") {
|
||||
resource.Links["patch"] = "blocked"
|
||||
}
|
||||
|
||||
if unstr, ok := resource.APIObject.Object.(*unstructured.Unstructured); ok {
|
||||
// with the sql cache, these were already added by the indexer. However, the sql cache
|
||||
// is only used for lists, so we need to re-add here for get/watch
|
||||
|
Reference in New Issue
Block a user