You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update verbs used to check SAR for users when k8s components are used
Update SAR checks for user permissions in webhook server to check
whether a user can get/create/update/delete the resource rather than
checking for '*' permissions. This is required as even if the user has
the admin rolebinding, they do not have '*' permissions from the
perspective of the cluster.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
returnfmt.Errorf("failed to create subjectaccessreview for request: %w", err)
121
-
}
122
-
123
-
username:=req.UserInfo.Username
124
-
ifusername=="" {
125
-
username=req.UserInfo.UID
126
-
}
127
-
if!sar.Status.Allowed {
128
-
returnfmt.Errorf("user %s does not have permissions to work with objects of kind %s defined in component %s", username, typeMeta.GroupVersionKind().String(), componentName)
107
+
// Check that user has permissions to use the resource
returnfmt.Errorf("failed to create subjectaccessreview for request: %w", err)
260
+
}
261
+
262
+
username:=req.UserInfo.Username
263
+
ifusername=="" {
264
+
username=req.UserInfo.UID
265
+
}
266
+
if!sar.Status.Allowed {
267
+
returnfmt.Errorf("user %s does not have permissions to '%s' objects of kind %s defined in component %s", username, verb, typeMeta.GroupVersionKind().String(), componentName)
0 commit comments