mirror of
https://github.com/pfzetto/rebacs
synced 2024-11-21 18:52:50 +01:00
new backend #2
This commit is contained in:
parent
1b53e041e3
commit
0b1af2771c
2 changed files with 12 additions and 5 deletions
|
@ -51,10 +51,11 @@ impl RelationService for GraphService {
|
||||||
return Err(Status::invalid_argument("dst.id must be set"));
|
return Err(Status::invalid_argument("dst.id must be set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !graph.has(
|
if !graph.has_recursive(
|
||||||
("themis_key", &*api_key),
|
("themis_key", &*api_key),
|
||||||
"write",
|
"write",
|
||||||
("themis_ns", &*req_dst.namespace),
|
("themis_ns", &*req_dst.namespace),
|
||||||
|
u32::MAX,
|
||||||
) {
|
) {
|
||||||
return Err(Status::permission_denied(
|
return Err(Status::permission_denied(
|
||||||
"missing dst.namespace write permissions",
|
"missing dst.namespace write permissions",
|
||||||
|
@ -127,10 +128,11 @@ impl RelationService for GraphService {
|
||||||
return Err(Status::invalid_argument("dst.id must be set"));
|
return Err(Status::invalid_argument("dst.id must be set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !graph.has(
|
if !graph.has_recursive(
|
||||||
("themis_key", &*api_key),
|
("themis_key", &*api_key),
|
||||||
"write",
|
"write",
|
||||||
("themis_ns", &*req_dst.namespace),
|
("themis_ns", &*req_dst.namespace),
|
||||||
|
u32::MAX,
|
||||||
) {
|
) {
|
||||||
return Err(Status::permission_denied(
|
return Err(Status::permission_denied(
|
||||||
"missing dst.namespace write permissions",
|
"missing dst.namespace write permissions",
|
||||||
|
@ -198,10 +200,11 @@ impl RelationService for GraphService {
|
||||||
return Err(Status::invalid_argument("dst.id must be set"));
|
return Err(Status::invalid_argument("dst.id must be set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !graph.has(
|
if !graph.has_recursive(
|
||||||
("themis_key", &*api_key),
|
("themis_key", &*api_key),
|
||||||
"read",
|
"read",
|
||||||
("themis_ns", &*req_dst.namespace),
|
("themis_ns", &*req_dst.namespace),
|
||||||
|
u32::MAX,
|
||||||
) {
|
) {
|
||||||
return Err(Status::permission_denied(
|
return Err(Status::permission_denied(
|
||||||
"missing dst.namespace write permissions",
|
"missing dst.namespace write permissions",
|
||||||
|
@ -272,13 +275,14 @@ impl QueryService for GraphService {
|
||||||
return Err(Status::invalid_argument("dst.id must be set"));
|
return Err(Status::invalid_argument("dst.id must be set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if !graph.has(
|
if !graph.has_recursive(
|
||||||
("themis_key", &*api_key),
|
("themis_key", &*api_key),
|
||||||
"read",
|
"read",
|
||||||
("themis_ns", &*req_dst.namespace),
|
("themis_ns", &*req_dst.namespace),
|
||||||
|
u32::MAX,
|
||||||
) {
|
) {
|
||||||
return Err(Status::permission_denied(
|
return Err(Status::permission_denied(
|
||||||
"missing dst.namespace write permissions",
|
"missing dst.namespace read permissions",
|
||||||
))?;
|
))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,6 +224,9 @@ impl RelationSet {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
for (rel, srcs) in rels_srcs.iter() {
|
for (rel, srcs) in rels_srcs.iter() {
|
||||||
|
if srcs.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let srcs = srcs
|
let srcs = srcs
|
||||||
.iter()
|
.iter()
|
||||||
.map(|src| {
|
.map(|src| {
|
||||||
|
|
Loading…
Reference in a new issue