1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-09 03:09:50 +00:00

Revert "Make view link related to GET RBAC permission. (#699)" (#703)

This reverts commit 542c471584.
This commit is contained in:
Sakala Venkata Krishna Rohit
2025-07-04 14:27:43 -07:00
committed by GitHub
parent 542c471584
commit 8cd7bd0a8f
2 changed files with 8 additions and 83 deletions

View File

@@ -121,22 +121,15 @@ func formatter(summarycache common.SummaryCache, asl accesscontrol.AccessSetLook
return
}
}
hasGet := accessSet.Grants("get", gvr.GroupResource(), resource.APIObject.Namespace(), resource.APIObject.Name())
hasUpdate := accessSet.Grants("update", gvr.GroupResource(), resource.APIObject.Namespace(), resource.APIObject.Name())
hasDelete := accessSet.Grants("delete", gvr.GroupResource(), resource.APIObject.Namespace(), resource.APIObject.Name())
hasPatch := accessSet.Grants("patch", gvr.GroupResource(), resource.APIObject.Namespace(), resource.APIObject.Name())
selfLink := selfLink(gvr, meta)
u := request.URLBuilder.RelativeToRoot(selfLink)
resource.Links["view"] = u
if hasGet {
if attributes.DisallowMethods(resource.Schema)[http.MethodGet] {
resource.Links["view"] = "blocked"
}
} else {
delete(resource.Links, "view")
}
if hasUpdate {
if attributes.DisallowMethods(resource.Schema)[http.MethodPut] {
resource.Links["update"] = "blocked"