KannarFr commented on a change in pull request #6428: [Issue 5720][authorization provider] (WIP) Add more granularity URL: https://github.com/apache/pulsar/pull/6428#discussion_r398545130
########## File path: pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/NamespaceOperation.java ########## @@ -0,0 +1,83 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.pulsar.common.policies.data; + +/** + * Namespace authorization operations. + */ +public enum NamespaceOperation { Review comment: We can probably simplify these actions I totally agree, I followed the validated PIP-49. Simplify them is really hard: for example, list Namespaces in a tenant should be tenant level authz but only for list Namespaces because it can be done by a tenant user. But set rates for tenant must only be done by super User and not a user, so we need these split. I guess we can have this issue a lot of times, not every endpoints, but it's hard to maintain. Which endpoint goes for this operation or this operation. Split all of them if easy to maintain. This comes with the defaultauthz provider which keeps the default role based as super user, tenant admin, or producer/consume authz. But the provider is passing the operations. The goal here is to enable plugins authz to have all authz powers and all the context to authorize. In default case role is a user, but when you consider role as a token with all authorized info deserialized in custom authz provider it's so powerful. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
