Skip to content

Commit

Permalink
auth fix: schema operations should rely on specific required-permissi…
Browse files Browse the repository at this point in the history
…on (#1387)

Change-Id: Iaa138ec23e779b4d2ca87a3bf46732bbfaa3bc1b
  • Loading branch information
javeme authored Mar 11, 2021
1 parent 17ac195 commit 5d48a93
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class EdgeLabelAPI extends API {
@Status(Status.CREATED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=edge_label_write"})
public String create(@Context GraphManager manager,
@PathParam("graph") String graph,
JsonEdgeLabel jsonEdgeLabel) {
Expand All @@ -85,7 +85,7 @@ public String create(@Context GraphManager manager,
@Path("{name}")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=edge_label_write"})
public String update(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name,
Expand All @@ -110,7 +110,7 @@ public String update(@Context GraphManager manager,
@GET
@Timed
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=edge_label_read"})
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
Expand Down Expand Up @@ -138,7 +138,7 @@ public String list(@Context GraphManager manager,
@Timed
@Path("{name}")
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=edge_label_read"})
public String get(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand All @@ -155,7 +155,7 @@ public String get(@Context GraphManager manager,
@Status(Status.ACCEPTED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_delete"})
@RolesAllowed({"admin", "$owner=$graph $action=edge_label_delete"})
public Map<String, Id> delete(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class IndexLabelAPI extends API {
@Status(Status.ACCEPTED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=index_label_write"})
public String create(@Context GraphManager manager,
@PathParam("graph") String graph,
JsonIndexLabel jsonIndexLabel) {
Expand Down Expand Up @@ -110,7 +110,7 @@ public String update(@Context GraphManager manager,
@GET
@Timed
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=index_label_read"})
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
Expand Down Expand Up @@ -138,7 +138,7 @@ public String list(@Context GraphManager manager,
@Timed
@Path("{name}")
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=index_label_read"})
public String get(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand All @@ -155,7 +155,7 @@ public String get(@Context GraphManager manager,
@Status(Status.ACCEPTED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_delete"})
@RolesAllowed({"admin", "$owner=$graph $action=index_label_delete"})
public Map<String, Id> delete(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class PropertyKeyAPI extends API {
@Status(Status.CREATED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=property_key_write"})
public String create(@Context GraphManager manager,
@PathParam("graph") String graph,
JsonPropertyKey jsonPropertyKey) {
Expand All @@ -86,7 +86,7 @@ public String create(@Context GraphManager manager,
@Path("{name}")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=property_key_write"})
public String update(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name,
Expand All @@ -112,7 +112,7 @@ public String update(@Context GraphManager manager,
@GET
@Timed
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=property_key_read"})
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
Expand Down Expand Up @@ -140,7 +140,7 @@ public String list(@Context GraphManager manager,
@Timed
@Path("{name}")
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=property_key_read"})
public String get(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand All @@ -155,7 +155,7 @@ public String get(@Context GraphManager manager,
@Timed
@Path("{name}")
@Consumes(APPLICATION_JSON)
@RolesAllowed({"admin", "$owner=$graph $action=schema_delete"})
@RolesAllowed({"admin", "$owner=$graph $action=property_key_delete"})
public void delete(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class VertexLabelAPI extends API {
@Status(Status.CREATED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=vertex_label_write"})
public String create(@Context GraphManager manager,
@PathParam("graph") String graph,
JsonVertexLabel jsonVertexLabel) {
Expand All @@ -86,7 +86,7 @@ public String create(@Context GraphManager manager,
@Path("{name}")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_write"})
@RolesAllowed({"admin", "$owner=$graph $action=vertex_label_write"})
public String update(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name,
Expand All @@ -113,7 +113,7 @@ public String update(@Context GraphManager manager,
@GET
@Timed
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=vertex_label_read"})
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
Expand Down Expand Up @@ -141,7 +141,7 @@ public String list(@Context GraphManager manager,
@Timed
@Path("{name}")
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_read"})
@RolesAllowed({"admin", "$owner=$graph $action=vertex_label_read"})
public String get(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand All @@ -158,7 +158,7 @@ public String get(@Context GraphManager manager,
@Status(Status.ACCEPTED)
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON_WITH_CHARSET)
@RolesAllowed({"admin", "$owner=$graph $action=schema_delete"})
@RolesAllowed({"admin", "$owner=$graph $action=vertex_label_delete"})
public Map<String, Id> delete(@Context GraphManager manager,
@PathParam("graph") String graph,
@PathParam("name") String name) {
Expand Down

0 comments on commit 5d48a93

Please sign in to comment.