By storing these custom MAPI roles in the ACL.
The extension field 'X-SOGO-COMPONENT-CREATED-BY' is used to store the
event creator when it is done from Outlook. It is the same field SOGo
uses when an event is created from a shared folder in the webmail.
The creator and the organizer/owner of the event can be different and it can
be used from external sources by checking the organizer field. This matches
the specification from [MS-OXOCAL] Section 1.1 which defines the organizer
as the owner or creator of the event.
This specifies a little the scope of the variable to make it
more realistic with the actual values it may have. We do have
a static typed compiled language, why don't we use it?
By restricting when FolderVisible right is set to the following rights:
* ReadAny
* EditAny
* DeleteAny
This goes beyond what specs says about when FolderVisible right is
mandatory but there is no more information stored in SOGo
(no possibility to set FolderVisible specific right)
See [MS-OXCPERM] Section 2.2.6 for more details
When Outlook sets the editor role, the FreeBusyDetailed and FreeBusySimple
right flags are set as Full Details are available.
When we store this information in SOGo, the SOGoCalendarRole_PublicModifier,
SOGoCalendarRole_PrivateModifier and SOGoCalendarRole_ConfidentialModifier
are stored as well as the free busy related roles, but as
[SOGoAppointmentFolder aclsForUser:forObjectAtPath] only returns the highest
access rights, we have to set as well the FreeBusy flags.
More details on [MS-OXCPERM] Section 2.2.6
According to [MS-OXCPERM] Section 2.2.7 in PidTagMemberRights possible
values, once we set the DeleteAny flag, the DeleteOwned flag must be set.
Likewise EditOwned must be set when EditAny is set. In this way,
the rights sent by the MAPI client are equal to the returned by the
server when Editor is set.
In real world practice, makes more strict Outlook 2013 work with editor permissions
the sharing of user's defined calendars, tasks or contacts folders as
the recipients can be editors of that folder.
Map: FreeBusySimple -> PublicDAndTViewer
FreeBusyDetailed -> ConfidentialDAndTViewer
Although SOGo is not really used AFAIK, we can now keep it and
keep Calendar permission issues consistent.
This fixes strange crashes when dealing with invitations and
other stuff. More work will need to be done in this regard. Also
kept the old code just in case for now. Will be cleaned up shortly
after more people test it.