mirror of
https://github.com/pfzetto/rebacs
synced 2024-11-22 11:12:49 +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"));
|
||||
}
|
||||
|
||||
if !graph.has(
|
||||
if !graph.has_recursive(
|
||||
("themis_key", &*api_key),
|
||||
"write",
|
||||
("themis_ns", &*req_dst.namespace),
|
||||
u32::MAX,
|
||||
) {
|
||||
return Err(Status::permission_denied(
|
||||
"missing dst.namespace write permissions",
|
||||
|
@ -127,10 +128,11 @@ impl RelationService for GraphService {
|
|||
return Err(Status::invalid_argument("dst.id must be set"));
|
||||
}
|
||||
|
||||
if !graph.has(
|
||||
if !graph.has_recursive(
|
||||
("themis_key", &*api_key),
|
||||
"write",
|
||||
("themis_ns", &*req_dst.namespace),
|
||||
u32::MAX,
|
||||
) {
|
||||
return Err(Status::permission_denied(
|
||||
"missing dst.namespace write permissions",
|
||||
|
@ -198,10 +200,11 @@ impl RelationService for GraphService {
|
|||
return Err(Status::invalid_argument("dst.id must be set"));
|
||||
}
|
||||
|
||||
if !graph.has(
|
||||
if !graph.has_recursive(
|
||||
("themis_key", &*api_key),
|
||||
"read",
|
||||
("themis_ns", &*req_dst.namespace),
|
||||
u32::MAX,
|
||||
) {
|
||||
return Err(Status::permission_denied(
|
||||
"missing dst.namespace write permissions",
|
||||
|
@ -272,13 +275,14 @@ impl QueryService for GraphService {
|
|||
return Err(Status::invalid_argument("dst.id must be set"));
|
||||
}
|
||||
|
||||
if !graph.has(
|
||||
if !graph.has_recursive(
|
||||
("themis_key", &*api_key),
|
||||
"read",
|
||||
("themis_ns", &*req_dst.namespace),
|
||||
u32::MAX,
|
||||
) {
|
||||
return Err(Status::permission_denied(
|
||||
"missing dst.namespace write permissions",
|
||||
"missing dst.namespace read permissions",
|
||||
))?;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,6 +224,9 @@ impl RelationSet {
|
|||
.await
|
||||
.unwrap();
|
||||
for (rel, srcs) in rels_srcs.iter() {
|
||||
if srcs.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let srcs = srcs
|
||||
.iter()
|
||||
.map(|src| {
|
||||
|
|
Loading…
Reference in a new issue