Masked email: x:MaskedEmail/changes and a state in /get (fork additions)
The fork's per-account change log answers /changes, collapsing a mask created and destroyed in the window. /changes on a registry type needs that type's get permission.
This commit is contained in:
@@ -247,8 +247,9 @@ impl JmapAuthorization for AccessToken {
|
||||
| MethodObject::PushSubscription
|
||||
| MethodObject::SearchSnippet
|
||||
| MethodObject::VacationResponse
|
||||
| MethodObject::SieveScript
|
||||
| MethodObject::Registry(_) => Permission::JmapEmailChanges,
|
||||
| MethodObject::SieveScript => Permission::JmapEmailChanges,
|
||||
// inbuxa: x:MaskedEmail/changes reads what /get reads
|
||||
MethodObject::Registry(object_type) => object_type.get_permission(),
|
||||
},
|
||||
RequestMethod::Copy(m) => match &m {
|
||||
CopyRequestMethod::Email(_) => Permission::JmapEmailCopy,
|
||||
|
||||
@@ -592,9 +592,14 @@ impl RequestHandler for Server {
|
||||
RequestMethod::Changes(mut req) => {
|
||||
resolve_account_id(&mut req.account_id, method_name.obj, access_token)?;
|
||||
|
||||
self.changes(*req, method_name.obj, access_token)
|
||||
.await?
|
||||
.into_method_response()
|
||||
// inbuxa: x:MaskedEmail/changes
|
||||
if matches!(method_name.obj, MethodObject::Registry(_)) {
|
||||
crate::inbuxa::masked_email::changes(self, access_token, *req).await?
|
||||
} else {
|
||||
self.changes(*req, method_name.obj, access_token)
|
||||
.await?
|
||||
.into_method_response()
|
||||
}
|
||||
}
|
||||
RequestMethod::Copy(req) => match req {
|
||||
CopyRequestMethod::Email(mut req) => {
|
||||
|
||||
Reference in New Issue
Block a user