fix: remove namespace creation restriction

This commit is contained in:
Andrey Melnikov 2021-10-28 15:50:39 -07:00
parent dd3d7f6632
commit 2cddf4a88a

View File

@ -105,10 +105,6 @@ func getClient(ctx context.Context, kubeConfig *v1.Config, db *v1.DB, sysConfig
}
func IsAuthorized(c *v1.Client, namespace, verb, group, resource, name string) (allowed bool, err error) {
if resource == "namespaces" && verb == "create" {
return false, status.Error(codes.PermissionDenied, "creating namespaces is not supported in the community edition")
}
review, err := c.AuthorizationV1().SelfSubjectAccessReviews().Create(&authorizationv1.SelfSubjectAccessReview{
Spec: authorizationv1.SelfSubjectAccessReviewSpec{
ResourceAttributes: &authorizationv1.ResourceAttributes{