imbajin commented on code in PR #3331:
URL: https://github.com/apache/hugegraph/pull/3331#discussion_r4279258644


##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/profile/GraphsAPI.java:
##########
@@ -693,6 +704,63 @@ public Map<String, GraphMode> mode(@Context GraphManager 
manager,
         return ImmutableMap.of("mode", g.mode());
     }
 
+    @GET
+    @Timed
+    @Path("{name}/mode/owners")
+    @Produces(APPLICATION_JSON_WITH_CHARSET)
+    @RolesAllowed({"space", "$owner=$name"})

Review Comment:
   ⚠️ Important: Graph-scoped import accounts cannot pass this role check. 
`Authorizer.matchPermission()` only expands variable permissions beginning with 
`$graphspace`; `$owner=$name` enters the literal-role branch with an empty 
graph-space. A graph-scoped STATUS WRITE user without the space role is denied 
before `loadingMode()` reaches the proxy permission check; the PUT route 
repeats this annotation at line 723. Please use the supported 
graph-space-qualified owner permission on both routes and add an authorization 
regression for a graph-scoped-only writer.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to