#[non_exhaustive]pub struct AddressBookRights {
pub may_read: bool,
pub may_write: bool,
pub may_share: bool,
pub may_delete: bool,
pub may_set_metadata: Option<bool>,
pub extra: Map<String, Value>,
}Expand description
Access rights a principal holds on an AddressBook (RFC 9610 §2).
All four rights are booleans. Default produces all-false, which is the
most restrictive valid value and a safe starting point when constructing
rights in tests or server code.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.may_read: boolUser may fetch the ContactCards in this AddressBook.
may_write: boolUser may create, modify, or destroy all ContactCards in this AddressBook, or move them to or from this AddressBook.
User may modify the shareWith property for this AddressBook.
may_delete: boolUser may delete the AddressBook itself.
may_set_metadata: Option<bool>User may modify the shared metadata of this AddressBook and of the
ContactCards in it (draft-ietf-jmap-metadata-04 §4.1).
None when the server omits it: the right is present only when the
metadata capability lists this type or a type it contains (§4.1).
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).
See ContactCard::extra for the
collision contract: programmatically inserting a key that
matches a typed field name produces a duplicate JSON object key
on serialize. Treat extra as a write-only catch-all for unknown
keys discovered at deserialize. JMAP-glx8.19.
See AddressBookRights::validate_extras for a runtime
pre-serialize check that detects this hazard. JMAP-glx8.25.
Implementations§
Source§impl AddressBookRights
impl AddressBookRights
Sourcepub fn validate_extras(&self) -> Result<(), CollisionError>
pub fn validate_extras(&self) -> Result<(), CollisionError>
Check that no extra key shadows a typed
wire-format field of this struct. Returns
Err(CollisionError) listing any colliding
keys; otherwise returns Ok(()). See
ContactCard::validate_extras
for the design rationale. JMAP-glx8.25.
§Errors
Returns CollisionError when one or more keys in
extra match one of the camelCase wire-format
names of this struct’s typed fields.