Class BlueMindAclEngine
- All Implemented Interfaces:
org.exoplatform.emailConnector.service.acl.MailboxAclEngine,org.springframework.core.Ordered
email.connector.aclEngine[.<connectorId>]=bluemind. BlueMind's proxy in front of the mailstore
drops IMAP SETACL (it answers * ALERT Missing analyzer), so
every write goes over BlueMind's REST API, as the caller, through the one
BlueMind port BlueMindMailboxTransport; the reads the proxy lets
through stay on IMAP, where the delegate's mail is synchronised from.
Contributed from the add-on's web application, as
BlueMindRuleEngine is: a @Service named "blueMindAddonAclEngine",
never final, ordered ORDER, guarded by the host's SPI, and
taking nothing private to the host. Without the add-on's transport it is
still registered and its probe answers unsupported.
What goes where.
- The owner's side over REST, on the owner's own session: a folder's list
is
GET _aclof the folder's records containermbox_records_<folder uid>, the uid read from the owner's folder listing by the folder's name, and its grant and removal a read-modify-write of it (PUT _acl); the whole mailbox's list isGET _aclsof the login's own mailbox, written the same way (POST _acls). The owner's folders and their roles are BlueMind's own listing. The grantee is resolved by address throughdirectory/_byEmail, the one lookup an ordinary user's session was seen to pass; an entry the directory does not know, or a route the deployment's proxy filters, fails closed and a uid is never guessed from an address. - The grantee's side on the grantee's own session. Which mailboxes are
shared with the grantee is BlueMind's answer over REST: the grantee's
mailboxaclsubscriptions, the grantee's own mailbox aside, one shared mailbox each -- never the folders of the IMAP listing, which shows a shared mailbox's folders as well as its root. Where each one is, andMYRIGHTSand the folders under it, are IMAP's (ImapAclEngine), because those names are the ones the delegate's synchronisation selects: a shared mailbox's root is the listed folder whose full name is the namespace's prefix and the owner's login (Autres utilisateurs/anais.francois). - The acceptance over REST, on the grantee's own session: a subscription
to
mailbox:acls-<ownerUid>, what BlueMind's own clients hold for a mailbox, after checking that the session is the account of the grantee's recorded address.
Verbs, not letters. A Reader is written Read and an Editor
Write; a list is read in its compact form (BlueMindAcls), so
a share made in BlueMind's interface reads as the same preset as one made
from eXo, and anything holding more (Manage, All,
ReadExtended) is custom, shown raw.
Per folder, and per mailbox beside it. eXo shares folder by folder,
as on an RFC 4314 server (GrantGranularity.FOLDER), on each folder's
own list -- the list BlueMind's own "share this folder" writes. BlueMind
also keeps a list for the whole mailbox, and the two add up: a folder's
entry adds to a whole-mailbox entry and never narrows it. So the capability
says mailboxScope; a folder's list is read with the whole mailbox's
entries merged in, each subject once, its scope AclScope.MAILBOX
when it holds the whole mailbox; a whole-mailbox entry is written and
removed only by grantWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String, org.exoplatform.emailConnector.model.DelegationPreset, org.exoplatform.emailConnector.model.MailboxRights) and revokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String);
and a folder write the whole-mailbox entry would contradict -- a narrower
access, a removal -- is refused rather than reported done. A Reader is
Read and an Editor Write on every folder, the owner's Trash
included (EDITOR_VERB_ON_TRASH). The owner's own rows, which
BlueMind lists under the owner's uid, are never a share. Nor is a subject
holding Visible
alone: BlueMind writes it on the mailbox's list while one of the owner's
folders is shared with that subject in its interface, and puts it back when
a removal takes it away from them. It is the footprint of a folder share:
never listed, never a reason for a removal to write, and no failure when a
removal reads it back.
The write, with no version to compare. POST _acls replaces the
whole list and BlueMind offers no ETag. A grant or a removal reads the list,
changes the grantee's rows only, writes the whole list back as it was read
(the owner's rows included, as verified live), and reads it again: the
grantee's compact set must be the one intended, and every other subject's
verbs unchanged, or the write is reported, never retried. The read and the
write are made back to back, but an edit made in BlueMind's interface
between them is overwritten, and the read-back cannot see it: the window is
the round trip, not zero. Two eXo writes to one owner's list on one node are
serialised; on two nodes they are not, and the later write wins. A list that
does not name the owner is never written back, so a list read in an
unexpected shape cannot take the owner's own rights away.
Writing in the owner's name. The owner's consent is written on the
grantee's rows of the whole mailbox's list, beside the access verb, in the
same read-modify-write: beside a whole-mailbox share, or, for a grantee
holding folders only, beside the Visible footprint those folder
shares keep there -- BlueMind's milter asks exactly the send verbs held on
that list (DelegationAction), whatever access goes with them. A
consent on that footprint is no whole-mailbox share
(BlueMindAcls.wholeShareOf(java.util.Collection<java.lang.String>)). The verbs: SendOnBehalf for on
behalf, SendAs alone for as the owner (BlueMind reads it back with
SendOnBehalf, which it implies), and neither once it is withdrawn.
A consent changed from one way to the other replaces the send verb, and a
consent the grantee already holds writes nothing; withdrawing it keeps the
access. A whole-mailbox grant replaces every row of the grantee there, send
verbs included, as the SPI
asks ("replaced, not widened"), and a folder's grant never touches them: the engine cannot tell a changed preset from a share offered
again after the grantee declined or left, when eXo no longer records a
consent, so it never carries a send verb into a grant. A consent the host
still records after a preset change is on the server again only once the
owner sets it again (grantSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String, org.exoplatform.emailConnector.model.SendMode)); until then the server holds
none. The host takes a consent off the server when the owner withdraws it
(revokeSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)) or removes the grantee: its removal of a share
runs revokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String) first, which takes the grantee's every row
off the mailbox's list, a consent beside folder shares with its
Visible footprint (BlueMind writes the footprint back while a folder
share stands). One eXo clears because the grantee declined or left stays on
the server until the owner's next grant or removal of that grantee. A send
verb set in
BlueMind's own interface is read as it stands and goes with any grant or
removal made from eXo.
Whose mailbox. Every write, and every subscription, first checks that the directory gives the session's own uid for the caller's recorded address: a login that is another account's never acts on a mailbox eXo does not record.
What the server does itself. BlueMind e-mails the owner on every
rights change (serverNotifiesOwner()). Removing the grantee's rows
does not withdraw the grantee's subscription: the owner's session cannot act
on the grantee's, and nothing in eXo withdraws it after a removal -- the
grantee's leave applies to a share in use only -- so the grantee's own
BlueMind client must.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe bean name, distinct from any name scanning gives a host bean.static final StringThe engine name a preset selects.static final intAhead of every engine that states no order: the add-on's one precedence.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionBlueMindAclEngine(Supplier<BlueMindMailboxTransport> transport) The engine over a transport.BlueMindAclEngine(org.springframework.beans.factory.ObjectProvider<BlueMindMailboxTransport> transports) The engine over the add-on's transport, when there is one. -
Method Summary
Modifier and TypeMethodDescriptionfindRoleFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) The owner's folders by role, from BlueMind's own listing: its default folders keep fixed English names (Sent,Trash,Junk,Drafts) at the top level, and BlueMind makes no Archive -- a top-level folder of the owner's whose name is an archive's usual name (FolderRole.ofUsualName(java.lang.String)) is the Archive.org.exoplatform.emailConnector.model.SharedMailboxfindSharedMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String ownerIdentifier) One owner's mailbox among those shared with the caller, by the same rule aslistSharedMailboxes(org.exoplatform.emailConnector.service.acl.MailboxAclSession): an owner known by address is the directory's uid for that address, an owner known by login the owner of the caller's subscription of that name, and either is found only among the caller's subscriptions -- never by a guess from an address's local part or from a folder's name.foldersHolding(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) The owner's folders whose own list gives the grantee a share, from one call that lists every shared folder (_shared), each named by the owner's folder listing; a shared container the listing does not name is left out.getName()The engine's name.intgetOrder()Where the registry sorts this engine among those it collects.org.exoplatform.emailConnector.model.MailboxAcegrant(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights) grant(MailboxAclSession, String, String, DelegationPreset, MailboxRights, FolderRole)on a folder of no role: INBOX, or a folder of the owner's own making.org.exoplatform.emailConnector.model.MailboxAcegrant(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights, org.exoplatform.emailConnector.model.FolderRole role) Grants a preset to one grantee on one of the owner's folders: the grantee's rows on the folder's own list replaced by the preset's one verb for the folder's role (verbFor(org.exoplatform.emailConnector.model.DelegationPreset, org.exoplatform.emailConnector.model.FolderRole)), capped by the owner's own letters there (an Editor the owner cannot cover is written a Reader, a Reader the owner cannot cover nothing), in a read-modify-write of that list that changes the grantee's rows only.voidgrantSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier, org.exoplatform.emailConnector.model.SendMode mode) Writes the owner's consent to one grantee writing mail in her name:SendOnBehalfforSendMode.ON_BEHALF,SendAsforSendMode.AS, in place of the send verb the grantee held, beside the grantee's access, which stays as it is.org.exoplatform.emailConnector.model.MailboxAcegrantWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights) Grants a preset to one grantee on the owner's whole mailbox: the grantee's access on the mailbox's list replaced by the preset's one verb (Read,Write), capped by the owner's own letters on INBOX, in a read-modify-write of the list that changes the grantee's rows only.org.exoplatform.emailConnector.model.MailboxRightslettersFor(org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.FolderRole role) The letters a preset stands for on a folder of a role: what its verb (verbFor(org.exoplatform.emailConnector.model.DelegationPreset, org.exoplatform.emailConnector.model.FolderRole)) pushes,lrpforReadandlrswipkxteforWrite.List<org.exoplatform.emailConnector.model.MailboxAce> Who holds which verbs on one of the owner's folders, over REST: the folder's own list merged with the whole mailbox's, each subject once, the owner's own rows left out, and a subject holdingVisiblealone on the mailbox -- the footprint a folder share leaves there (BlueMindAcls.wholeShareOf(java.util.Collection<java.lang.String>)), with or without a send verb -- held as no whole-mailbox share.listAcls(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, List<String> folders) Several of the owner's folders' lists at once, in one session and a fixed number of requests whatever the number of folders: the owner's folder listing, the whole mailbox's list, and every shared folder's rows from one_sharedcall (as stored: compact, the owner left out), each merged aslistAcl(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)merges them, and one directory lookup per subject.List<org.exoplatform.emailConnector.model.DiscoveredFolder> listFoldersUnder(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String root, String delimiter) The folders of a shared mailbox, over IMAP.List<org.exoplatform.emailConnector.model.OwnFolder> listOwnFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) The owner's own folders, from BlueMind's own listing, each with its role (findRoleFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession)), INBOX included; BlueMind'sTemplatesandOutboxare never offered.List<org.exoplatform.emailConnector.model.SharedMailbox> listSharedMailboxes(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) The mailboxes shared with the caller: one per mailbox the caller is subscribed to on BlueMind (mailboxaclsubscriptions, the caller's own aside), never one per folder of the caller's IMAP listing.org.exoplatform.emailConnector.model.MailboxRightsThe caller's rights on one mailbox, over IMAP (MYRIGHTSpasses BlueMind's proxy).org.exoplatform.emailConnector.model.DelegationPresetpresetOf(org.exoplatform.emailConnector.model.MailboxRights rights) The preset a delegate's own IMAP letters are on BlueMind:lrp(whatReadpushes) a Reader,lrswipkxte(whatWritepushes) an Editor, else the plain IMAP reading.org.exoplatform.emailConnector.model.MailboxAclCapabilitiesprobe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) What the server can do, decided by attempting it: a login as the caller and a read of the caller's own mailbox's list.voidrevoke(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier) Removes one grantee's rows from one of the owner's folders, in a read-modify-write of that folder's list; nothing is written when the list names no share of the grantee, or the owner's listing no longer holds the folder.voidrevokeSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) Takes the owner's consent to one grantee writing mail in her name off the list: both send verbs removed, the grantee's access kept as it is.voidrevokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) Removes every row of one grantee from the owner's whole mailbox's list, send verbs included, in a read-modify-write of it.booleanBlueMind e-mails the owner on every rights change.voidsubscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String ownerIdentifier) Accepts a share on BlueMind: subscribes the caller to the owner's mailbox, as BlueMind's own clients hold it, once the caller's session is checked to be the account of the caller's recorded address.voidunsubscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String ownerIdentifier) Withdraws the caller's subscription to the owner's mailbox, once the caller's session is checked assubscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)checks it.
-
Field Details
-
NAME
The engine name a preset selects.- See Also:
-
BEAN_NAME
The bean name, distinct from any name scanning gives a host bean.- See Also:
-
ORDER
public static final int ORDERAhead of every engine that states no order: the add-on's one precedence.- See Also:
-
-
Constructor Details
-
BlueMindAclEngine
@Autowired public BlueMindAclEngine(org.springframework.beans.factory.ObjectProvider<BlueMindMailboxTransport> transports) The engine over the add-on's transport, when there is one.- Parameters:
transports- the add-on's transport, possibly absent
-
BlueMindAclEngine
The engine over a transport.- Parameters:
transport- supplies the transport, or null when there is none
-
-
Method Details
-
getName
The engine's name.- Specified by:
getNamein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Returns:
- "bluemind"
-
getOrder
public int getOrder()Where the registry sorts this engine among those it collects.- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Returns:
ORDER
-
probe
public org.exoplatform.emailConnector.model.MailboxAclCapabilities probe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) What the server can do, decided by attempting it: a login as the caller and a read of the caller's own mailbox's list. Every failure answers unsupported with its code: no transport or no server isunsupported.provider, no material or a server that cannot be reachedunreachable, a server that refuses the readunsupported.- Specified by:
probein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the caller's own session- Returns:
- the capabilities, never null
-
myRights
public org.exoplatform.emailConnector.model.MailboxRights myRights(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox) The caller's rights on one mailbox, over IMAP (MYRIGHTSpasses BlueMind's proxy).- Specified by:
myRightsin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the caller's own sessionmailbox- the mailbox's full name- Returns:
- the rights
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be asked
-
listAcl
public List<org.exoplatform.emailConnector.model.MailboxAce> listAcl(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox) Who holds which verbs on one of the owner's folders, over REST: the folder's own list merged with the whole mailbox's, each subject once, the owner's own rows left out, and a subject holdingVisiblealone on the mailbox -- the footprint a folder share leaves there (BlueMindAcls.wholeShareOf(java.util.Collection<java.lang.String>)), with or without a send verb -- held as no whole-mailbox share. A subject holding the whole mailbox is listed atAclScope.MAILBOXwith the verbs of both lists, which add up; one holding the folder alone atAclScope.FOLDER. Each subject is named by its directory address when the directory gives one, else by its uid; its letters, native form and preset are read from its compact verb set. One directory lookup per subject listed, one after the other: a list of N subjects costs N + 3 requests (the folder listing and both lists), as the directory offers no batched read verified on an ordinary user's session. A lookup that fails fails the list, rather than naming a subject the host could not match to its record.- Specified by:
listAclin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionmailbox- the folder's full name, INBOX matched ignoring case- Returns:
- the entries, the whole mailbox's subjects first, in BlueMind's order
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedfor a folder the owner's listing does not hold, and when the server refuses or cannot be asked
-
listAcls
public Map<String,List<org.exoplatform.emailConnector.model.MailboxAce>> listAcls(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, List<String> folders) Several of the owner's folders' lists at once, in one session and a fixed number of requests whatever the number of folders: the owner's folder listing, the whole mailbox's list, and every shared folder's rows from one_sharedcall (as stored: compact, the owner left out), each merged aslistAcl(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)merges them, and one directory lookup per subject. A folder no share names lists the whole mailbox's subjects only; a folder the owner's listing does not hold is left out of the answer.- Specified by:
listAclsin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionfolders- the folders' full names- Returns:
- each folder's entries, by full name, in the order asked
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be asked
-
grant
public org.exoplatform.emailConnector.model.MailboxAce grant(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights) grant(MailboxAclSession, String, String, DelegationPreset, MailboxRights, FolderRole)on a folder of no role: INBOX, or a folder of the owner's own making.- Specified by:
grantin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionmailbox- the folder's full nameidentifier- the grantee's addresspreset- READER or EDITORownerRights- the owner's own letters on that folder- Returns:
- the grantee's entry on the folder as written
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- as the role's grant
-
grant
public org.exoplatform.emailConnector.model.MailboxAce grant(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights, org.exoplatform.emailConnector.model.FolderRole role) Grants a preset to one grantee on one of the owner's folders: the grantee's rows on the folder's own list replaced by the preset's one verb for the folder's role (verbFor(org.exoplatform.emailConnector.model.DelegationPreset, org.exoplatform.emailConnector.model.FolderRole)), capped by the owner's own letters there (an Editor the owner cannot cover is written a Reader, a Reader the owner cannot cover nothing), in a read-modify-write of that list that changes the grantee's rows only. Refused before anything is written when the grantee's whole-mailbox entry gives more than the verb: the folder would keep that access, whatever its own list says.- Specified by:
grantin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionmailbox- the folder's full name, INBOX matched ignoring caseidentifier- the grantee's addresspreset- READER or EDITORownerRights- the owner's own letters on that folderrole- the folder's role, null for INBOX and the owner's own folders- Returns:
- the grantee's entry on the folder as written
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-nothingToGrantwhen nothing is left to grant or the grantee is the owner,serverRefusedfor a folder the owner's listing does not hold, a grantee the directory does not give, a whole-mailbox entry that gives more, or a list that changed under the write,notRecordedwhen the list does not hold the grant afterwards
-
grantWholeMailbox
public org.exoplatform.emailConnector.model.MailboxAce grantWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier, org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.MailboxRights ownerRights) Grants a preset to one grantee on the owner's whole mailbox: the grantee's access on the mailbox's list replaced by the preset's one verb (Read,Write), capped by the owner's own letters on INBOX, in a read-modify-write of the list that changes the grantee's rows only. A send verb the grantee holds goes with the rows it replaces: a grant never carries a consent to writing in the owner's name, which onlygrantSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String, org.exoplatform.emailConnector.model.SendMode)writes.- Specified by:
grantWholeMailboxin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionidentifier- the grantee's addresspreset- READER or EDITORownerRights- the owner's own letters on INBOX- Returns:
- the grantee's whole-mailbox entry as the list holds it after the write
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-nothingToGrantwhen nothing is left to grant or the grantee is the owner,serverRefusedfor a grantee the directory does not give, or a list that changed under the write,notRecordedwhen the list does not hold the grant afterwards
-
grantSendMode
public void grantSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier, org.exoplatform.emailConnector.model.SendMode mode) Writes the owner's consent to one grantee writing mail in her name:SendOnBehalfforSendMode.ON_BEHALF,SendAsforSendMode.AS, in place of the send verb the grantee held, beside the grantee's access, which stays as it is. The grantee is resolved by address, as a grant resolves them, and must hold a share: a whole-mailbox share on the list, or one of the owner's folders (_shared), whoseVisiblefootprint on the list the consent then sits beside, the footprint written with it when the list does not carry it. A consent is never a share of its own. Nothing is written when the grantee holds that consent already.- Specified by:
grantSendModein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionidentifier- the grantee's addressmode- ON_BEHALF or AS- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedfor another mode, an identifier that is not an address, a grantee the directory does not give or who is the owner, a grantee holding neither a whole-mailbox share nor a folder share, or a list that changed under the write;notRecordedwhen the list does not hold the consent afterwards
-
revokeSendMode
public void revokeSendMode(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) Takes the owner's consent to one grantee writing mail in her name off the list: both send verbs removed, the grantee's access kept as it is. Nothing is written when the grantee holds neither, or the list names no row of them; the grantee is named asrevoke(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String, java.lang.String)names them.- Specified by:
revokeSendModein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionidentifier- the grantee's address, or the uid the list names them by- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedfor a blank identifier, the owner's own uid, a directory that cannot be asked, a grantee whose access implies sending (All, set in BlueMind's own interface), or a list that changed under the write;notRecordedwhen the list still holds a send verb of the grantee afterwards
-
revoke
public void revoke(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String mailbox, String identifier) Removes one grantee's rows from one of the owner's folders, in a read-modify-write of that folder's list; nothing is written when the list names no share of the grantee, or the owner's listing no longer holds the folder. The grantee's whole-mailbox entry is never touched here (revokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)): when they hold one, the folder stays theirs through it, and the removal is refused after the folder's own rows are gone, rather than reported done. A consent beside folder shares is not touched here either:revokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)takes it off.- Specified by:
revokein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionmailbox- the folder's full name, INBOX matched ignoring caseidentifier- the grantee's address, or the uid the list names them by- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedfor a blank identifier, the owner's own uid, a directory that cannot be asked, a list that changed under the write, or a grantee who keeps the folder through the whole mailbox;notRecordedwhen the folder's list still holds a share of the grantee
-
revokeWholeMailbox
public void revokeWholeMailbox(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) Removes every row of one grantee from the owner's whole mailbox's list, send verbs included, in a read-modify-write of it. Nothing is written when the list names no share of the grantee: no row, orVisiblealone, the footprint of a folder share, which BlueMind keeps for as long as a folder of the owner's is shared with the grantee. A removal BlueMind answers with that footprint put back is recorded (checkWritten(java.util.List<org.exoplatform.bluemind.client.model.BlueMindAclEntry>, java.util.List<org.exoplatform.bluemind.client.model.BlueMindAclEntry>, java.lang.String, java.util.Set<java.lang.String>)). A consent to writing in the owner's name beside the footprint is rows to remove here, the footprint with it: the host's removal of a grantee runs this first, and it is how a consent beside folder shares leaves the server, so the test isBlueMindAcls.shareOf(java.util.Collection<java.lang.String>), neverBlueMindAcls.wholeShareOf(java.util.Collection<java.lang.String>). The grantee's folder rows are left torevoke(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String, java.lang.String).- Specified by:
revokeWholeMailboxin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionidentifier- the grantee's address, or the uid the list names them by- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedfor a blank identifier, the owner's own uid, a directory that cannot be asked, or a list that changed under the write;notRecordedwhen the list still holds a share of the grantee
-
findRoleFolders
public Map<org.exoplatform.emailConnector.model.FolderRole,String> findRoleFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) The owner's folders by role, from BlueMind's own listing: its default folders keep fixed English names (Sent,Trash,Junk,Drafts) at the top level, and BlueMind makes no Archive -- a top-level folder of the owner's whose name is an archive's usual name (FolderRole.ofUsualName(java.lang.String)) is the Archive. The first folder found for a role keeps it.- Specified by:
findRoleFoldersin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own session- Returns:
- the folder full name of each role found, never null
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be asked
-
listOwnFolders
public List<org.exoplatform.emailConnector.model.OwnFolder> listOwnFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession session) The owner's own folders, from BlueMind's own listing, each with its role (findRoleFolders(org.exoplatform.emailConnector.service.acl.MailboxAclSession)), INBOX included; BlueMind'sTemplatesandOutboxare never offered. The names are the full names the listing gives,/between levels -- the names the owner's IMAP session shows and the folder's list is found by.- Specified by:
listOwnFoldersin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own session- Returns:
- the folders, in BlueMind's order
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be asked
-
foldersHolding
public List<String> foldersHolding(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String identifier) The owner's folders whose own list gives the grantee a share, from one call that lists every shared folder (_shared), each named by the owner's folder listing; a shared container the listing does not name is left out. INBOX is among them when shared; the whole mailbox's list is not a folder's.- Specified by:
foldersHoldingin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the owner's own sessionidentifier- the grantee's address, or the uid the list names them by- Returns:
- the folder full names, possibly empty, never null
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be asked
-
lettersFor
public org.exoplatform.emailConnector.model.MailboxRights lettersFor(org.exoplatform.emailConnector.model.DelegationPreset preset, org.exoplatform.emailConnector.model.FolderRole role) The letters a preset stands for on a folder of a role: what its verb (verbFor(org.exoplatform.emailConnector.model.DelegationPreset, org.exoplatform.emailConnector.model.FolderRole)) pushes,lrpforReadandlrswipkxteforWrite. BlueMind's levels are coarse: an Editor holdsewherever it holdsWrite.- Specified by:
lettersForin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
preset- READER or EDITORrole- the folder's role, null for INBOX and the owner's own folders- Returns:
- the letters, before any cap; none for a preset not granted
-
listFoldersUnder
public List<org.exoplatform.emailConnector.model.DiscoveredFolder> listFoldersUnder(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String root, String delimiter) The folders of a shared mailbox, over IMAP.- Specified by:
listFoldersUnderin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the grantee's own sessionroot- the shared mailbox's rootdelimiter- the hierarchy delimiter- Returns:
- the folders
- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException- when the server refuses or cannot be reached
-
presetOf
public org.exoplatform.emailConnector.model.DelegationPreset presetOf(org.exoplatform.emailConnector.model.MailboxRights rights) The preset a delegate's own IMAP letters are on BlueMind:lrp(whatReadpushes) a Reader,lrswipkxte(whatWritepushes) an Editor, else the plain IMAP reading. The letters come from BlueMind'sAcl.javaand were not yet observed on a delegate'sMYRIGHTS.- Specified by:
presetOfin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
rights- the letters a server answered- Returns:
- the preset
-
subscribe
public void subscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String ownerIdentifier) Accepts a share on BlueMind: subscribes the caller to the owner's mailbox, as BlueMind's own clients hold it, once the caller's session is checked to be the account of the caller's recorded address. An owner eXo knows by login only -- discovered while BlueMind could not name it by address -- cannot be subscribed to from eXo: the subscription of that name must be held already, and once the grantee has left it, it can be taken up again only in BlueMind's own interface.- Specified by:
subscribein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the grantee's own sessionownerIdentifier- the owner's address, or login- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedwhen the session is not the recorded account, the owner cannot be resolved, or the owner is the caller
-
unsubscribe
public void unsubscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, String ownerIdentifier) Withdraws the caller's subscription to the owner's mailbox, once the caller's session is checked assubscribe(org.exoplatform.emailConnector.service.acl.MailboxAclSession, java.lang.String)checks it. An owner the directory no longer knows has nothing to withdraw.- Specified by:
unsubscribein interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Parameters:
session- the grantee's own sessionownerIdentifier- the owner's address- Throws:
org.exoplatform.emailConnector.exception.MailboxAclException-serverRefusedwhen the session is not the recorded account, or the owner is the caller
-
serverNotifiesOwner
public boolean serverNotifiesOwner()BlueMind e-mails the owner on every rights change.- Specified by:
serverNotifiesOwnerin interfaceorg.exoplatform.emailConnector.service.acl.MailboxAclEngine- Returns:
- true
-