Registry store implementation - part 1
This commit is contained in:
@@ -12,7 +12,7 @@ use jmap_proto::{
|
||||
types::state::State,
|
||||
};
|
||||
use jmap_tools::{Key, Map, Value};
|
||||
use registry::schema::prelude::{Object, Permission, Property};
|
||||
use registry::schema::prelude::{Object, Permission};
|
||||
use std::future::Future;
|
||||
use store::{registry::RegistryQuery, roaring::RoaringBitmap};
|
||||
use trc::AddContext;
|
||||
@@ -52,8 +52,7 @@ impl PrincipalGet for Server {
|
||||
let principal_ids = self
|
||||
.registry()
|
||||
.query::<RoaringBitmap>(
|
||||
RegistryQuery::new(Object::Account)
|
||||
.equal_opt(Property::MemberTenantId, access_token.tenant_id()),
|
||||
RegistryQuery::new(Object::Account).with_tenant(access_token.tenant_id()),
|
||||
)
|
||||
.await
|
||||
.caused_by(trc::location!())?;
|
||||
|
||||
@@ -52,8 +52,7 @@ impl PrincipalQuery for Server {
|
||||
let principal_ids = self
|
||||
.registry()
|
||||
.query::<RoaringBitmap>(
|
||||
RegistryQuery::new(Object::Account)
|
||||
.equal_opt(Property::MemberTenantId, access_token.tenant_id()),
|
||||
RegistryQuery::new(Object::Account).with_tenant(access_token.tenant_id()),
|
||||
)
|
||||
.await
|
||||
.caused_by(trc::location!())?;
|
||||
@@ -88,10 +87,7 @@ impl PrincipalQuery for Server {
|
||||
self.registry()
|
||||
.query::<RoaringBitmap>(
|
||||
RegistryQuery::new(Object::Account)
|
||||
.equal_opt(
|
||||
Property::MemberTenantId,
|
||||
access_token.tenant_id(),
|
||||
)
|
||||
.with_tenant(access_token.tenant_id())
|
||||
.text(text),
|
||||
)
|
||||
.await
|
||||
@@ -113,10 +109,7 @@ impl PrincipalQuery for Server {
|
||||
.query::<RoaringBitmap>(
|
||||
RegistryQuery::new(Object::Account)
|
||||
.equal(Property::Type, typ.to_id())
|
||||
.equal_opt(
|
||||
Property::MemberTenantId,
|
||||
access_token.tenant_id(),
|
||||
),
|
||||
.with_tenant(access_token.tenant_id()),
|
||||
)
|
||||
.await
|
||||
.caused_by(trc::location!())?,
|
||||
|
||||
Reference in New Issue
Block a user