jerqi commented on code in PR #9283:
URL: https://github.com/apache/gravitino/pull/9283#discussion_r2571370827


##########
server/src/main/java/org/apache/gravitino/server/web/rest/JobOperations.java:
##########
@@ -329,8 +385,11 @@ public Response runJob(@PathParam("metalake") String 
metalake, JobRunRequest req
   @Path("runs/{jobId}")
   @Produces("application/vnd.gravitino.v1+json")
   @Timed(name = "cancel-job." + MetricNames.HTTP_PROCESS_DURATION, absolute = 
true)
+  @AuthorizationExpression(expression = "METALAKE::OWNER || JOB::OWNER")
   public Response cancelJob(
-      @PathParam("metalake") String metalake, @PathParam("jobId") String 
jobId) {
+      @PathParam("metalake") @AuthorizationMetadata(type = 
Entity.EntityType.METALAKE)
+          String metalake,
+      @AuthorizationMetadata(type = Entity.EntityType.JOB) @PathParam("jobId") 
String jobId) {

Review Comment:
   Yes, we can.   
   ```
   public static NameIdentifier ofJob(String metalake, String jobName) {
       return NameIdentifier.of(NamespaceUtil.ofJob(metalake), jobName);
     }
   ```



-- 
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]

Reply via email to