Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth fix: schema operations should rely on specific required-permission #1387

Merged
merged 1 commit into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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