michaeljmarshall commented on code in PR #15576:
URL: https://github.com/apache/pulsar/pull/15576#discussion_r872619231
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/Namespaces.java:
##########
@@ -314,6 +314,49 @@ public void
revokePermissionOnSubscription(@PathParam("property") String propert
internalRevokePermissionsOnSubscription(subscription, role);
}
+ @PUT
+ @Path("/{property}/{cluster}/{namespace}/implicitPermissionOnSubscription")
+ @ApiOperation(hidden = true, value = "Allow a consumer's role to have
implicit permission to consume from a"
+ + " subscription.")
+ @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponse(code = 404, message = "Property or cluster or
namespace doesn't exist"),
+ @ApiResponse(code = 409, message = "Concurrent modification"),
+ @ApiResponse(code = 501, message = "Authorization is not
enabled")})
+ public void grantImplicitPermissionOnSubscription(
+ @PathParam("property") String property, @PathParam("cluster")
String cluster,
+ @PathParam("namespace") String namespace) {
+ validateNamespaceName(property, cluster, namespace);
+ internalSetImplicitPermissionOnSubscription(true);
+ }
+
+ @DELETE
+ @Path("/{property}/{cluster}/{namespace}/implicitPermissionOnSubscription")
+ @ApiOperation(hidden = true, value = "Require a consumer's role to have
explicit permission to consume from a"
+ + " subscription.")
+ @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponse(code = 404, message = "Property or cluster or
namespace doesn't exist"),
+ @ApiResponse(code = 409, message = "Concurrent modification"),
+ @ApiResponse(code = 501, message = "Authorization is not
enabled")})
+ public void revokeImplicitPermissionOnSubscription(
+ @PathParam("property") String property, @PathParam("cluster")
String cluster,
+ @PathParam("namespace") String namespace) {
+ validateNamespaceName(property, cluster, namespace);
+ internalSetImplicitPermissionOnSubscription(false);
+ }
+
+ @GET
+ @Path("/{property}/{cluster}/{namespace}/implicitPermissionOnSubscription")
+ @ApiOperation(value = "Get permission on subscription required for
namespace.")
+ @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponse(code = 404, message = "Property or cluster or
namespace doesn't exist"),
+ @ApiResponse(code = 409, message = "Namespace is not empty")})
+ public boolean getImplicitPermissionOnSubscription(@PathParam("property")
String property,
+ @PathParam("cluster")
String cluster,
+ @PathParam("namespace")
String namespace) {
+ validateNamespaceName(property, cluster, namespace);
+ return getImplicitPermissionOnSubscription();
+ }
+
Review Comment:
Good question, I'm not sure. I don't know how we're approaching new features
like this. I'm open to removing it, if that's the consensus.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]