Commit graph

119 commits

Author SHA1 Message Date
Enrique J. Hernández Blasco 12e952eb55 oc: Honor calendar WebMail UI permissions on OpenChange library
By expanding roles from the given ACL to have these values as flags
inside the OpenChange library. This only applies to Calendar and
Tasks folders which stored four different access rights to three
different types of events/tasks.

As the events and tasks are stored in the same table, I have added
two new classes to manage permissions in the same way and this
avoids the code duplication called MAPIStoreCalTask(Folder|Message).
2016-02-23 10:10:48 +01:00
Enrique J. Hernández Blasco 8b45ee886b oc: Use the same permission set original from MAPIStoreDBFolder
To keep backwards compatibility.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 76e586deca oc: Added custom MAPI permissions
This set is only available at sogo-openchange library scope but
they are useful to provide all permissions set from any MAPI client
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco dcb1d2f574 oc: API to know if a message can be deleted by a subscriber
Instead of asking general container. This gives the possibility to
perform the deletion depending on the data from the message, for instance,
the user creator.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco bcf94c5b43 oc: Check FolderOwner right to modify permissions
As specified by [MS-OXCPERM] Section 3.2.5.2, the ModifyPermissions ROP
is only possible to users which have this right.

After this changeset, we check the active user can modify permission
list. This is a security fix.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 8c8ad301b4 oc: Check FolderVisible permission to show permission list
When the active user is not the owner of the resource as specified
by [MS-OXCPERM] Section 3.2.5.1
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 026c37709a oc: Mimetise PidTagRights behaviour to PidTagMemberRights
As specified by [MS-OXCFOLD] Section 2.2.2.2.2.8 we exclude
FreeBusySimple and FreeBusyDetailed right flags.
2016-02-16 14:55:20 +01:00
Enrique J. Hernández Blasco e08ee9a265 oc: Use enum mapistore_error instead of int
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?
2016-02-15 15:44:14 +01:00
Carlos Pérez-Aradros Herce 9554e92c8b Adapt to new safe_ldb_search function 2015-11-23 17:01:35 +01:00
Enrique J. Hernández Blasco 321672e2c3 oc: Update predecessor change list on saving
There were cases where only the change key was updated (GCS) or
others were the change key was updated with wrong info.

This changeset has as goal to update the predecessor change list
and, change key if required, on saving taking into account the latest information
given by the client in high level ROPs such as ImportMessageMove
or SetProperties, and merge it with information provided by the server
backend (IMAP server, SOGo DB) using `synchroniseCache`.

For more details about `PidTagChangeKey` and `PidTagPredecessorChangeList`
property values check [MS-OXCFXICS] Section 2.2.1.2
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 8d9b54815c oc: Receive new predecessor change list parameter on move copy op
This is to apply new API introduced by 85e2d7c commit in OpenChange
repository.
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 2aba083147 oc: Update ChangeNumber after setting folder properties
As required by operations like SynchronizationImportHierarchyChanges
a new change number must be generated when a change in a folder
is set. This affects to subfolders.

See [MS-OXCFXICS] Section 3.2.5.9.4.3 for details.
2015-07-30 10:07:55 +02:00
Jesús García Sáez 10bc15d41d oc-folder: activate user context when needed
Before creating sogo objects
2015-07-21 11:08:02 +02:00
Jesús García Sáez 393b6d5128 oc-folder: simplify lookupFolder method
use activate and no need to set wocontext, it's already set properly
2015-07-21 11:08:02 +02:00
Jesús García Sáez b7907d654d Merge pull request #127 from Zentyal/jkerihuel/asynchronous-notifications
[oxcnotif] Delete deprecated notification code
2015-04-22 12:45:20 +02:00
Julien Kerihuel d4930a7960 oc: Remove deprecated notification code. 2015-04-16 16:04:47 +02:00
Enrique J. Hernández Blasco bddd67fb93 oc: Enforce the folder creation mapping when the FID exists
We believe the folder ID OpenChange is sending us is new
and we keep the indexing database properly updated.

Although the solution is not elegant, this could avoid
inconsistencies between what the client stores and the
relation in the MAPIStore backend.
2015-04-13 11:48:42 +02:00
Enrique J. Hernández Blasco 8ee2303e78 oc: Empty ACL from a folder works with several users
The `[SOGoFolder:aclUsers]` returns a reference to a `NSArray`
which is being modified in the `for` loop making fail when
more than one user is in the ACL with `NSRangeException`.
2015-03-19 00:06:14 +01:00
Enrique J. Hernández Blasco b01de763da oc: Move back and forth folders now are in sync
Two different indexing entries were created on move operation making
impossible to restore old folder position in the original parent folder.
This was due to cleanupCaches message calls to objectId which requires
to have the indexing entry available.

Use case:

  * Restore a folder from "Deleted items" folders
2015-01-27 18:27:11 +01:00
Enrique J. Hernández Blasco 99a36be034 oc: Remove a source folder on move folder operation
Calling deleteFolder message to actually remove it from DB/IMAP
depending on the class.
2015-01-21 12:44:31 +01:00
Jesús García Sáez f9550b9181 oc: several uninitialized variables 2015-01-19 15:35:44 +01:00
Enrique J. Hernández Blasco dba17fbcbc Create child folder objects using parent context for real
We activate the user for the context using the root folder
context as there are times where the active user is not
matching with the one stored in the application context
and SOGo object is storing cached data with the wrong user
leading to create folders in wrong mailboxes, etc.

As this application is single-threaded, no problems are expected.
Indeed, the same code is available at getting the root folder (ie INBOX).
2014-12-16 23:43:57 +01:00
Enrique J. Hernández Blasco 067809ef1c Store changeNumber maps with modseq in cache for subfolders
By getting the root folder/container whose properties
are stored in OpenChange DB.

This makes the synchronisation of sub-folders faster as
when we evaluate restrictions for this folder, we are able
to get the modseq from where to get the latest messages
unseen by the client.
2014-12-01 23:19:38 +01:00
Enrique J. Hernández Blasco ef7b919175 Return MAPISTORE_ERR_NOT_FOUND when a mail is indexed but not in IMAP server
And remove that entry from the indexing table.

This avoids to crash getting properties from a no longer available message
in the IMAP server, for instance, the `PidTagPredecessorChangeList` attribute.
2014-11-19 17:12:32 +01:00
Enrique J. Hernández Blasco 3910769ae8 oc-folder: Uniform call to deleteMessageWithMID
To make sure flags argument is used accordingly with the specs
and not working by chance.
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco b67e1deda5 oc-folder: Make deleted items synched when shared
By keeping mid on moving messages by soft deleting and
only if srcMid is different from targetMid.

This makes restore/shared deleted items work.

It also requires to do the following to work smoothly:

* Do not add soft-deleted messages in ensureIDsForChildKeys
* Return soft-deleted messages on getDeletedFMIDs
* Do not register a new mid if the URL is matched with soft deleted messages
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco be60fdebcc oc-folder: Flags are now used in indexing db when deleting a msg
Unregistering the URL in indexing db accordingly to the flags (SOFT or HARD)
2014-11-19 17:12:30 +01:00
Kamen Mazdrashki dd7200e00f openchange/MAPIStoreFolder: Add private selector for actual folder delete action
Usually, it is a bad idea for an object to call its own public methods
(just like in this case). Thus separating impelementation for deleteFolder:
would allow MAPIStoreFolder to call only private implementation when needed

Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
2014-07-02 14:58:33 +02:00
Ludovic Marcotte 7a4feae8b8 Updated code to reflect cache regorg. 2014-05-14 06:56:05 -04:00
Ludovic Marcotte 99d49b9bd9 Updated code to use the category 2014-05-13 21:14:57 -04:00
Ludovic Marcotte 5f9fb4e1c4 Big refactor for new caching mechanism. 2014-05-13 21:06:59 -04:00
Ludovic Marcotte 41e6fb89d3 Renamed constants in preparation for the big cache cleanup 2014-05-13 17:54:02 -04:00
Ludovic Marcotte 93f9a7273e Now handle mem context when saving messages and removed useless debugging. 2013-03-13 15:04:11 -04:00
Ludovic Marcotte 4804337a01 Now pass the memory context when copying/moving folders. 2012-12-07 13:30:50 -05:00
Ludovic Marcotte 2017536beb move_copy_messages now uses the openchange's memory context.
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.
2012-12-03 09:18:17 -05:00
Wolfgang Sourdeau 63abe73c29 ensureIDsForChildKeys: new helper method that ensure that the child keys have a corresponding fmid and register them with -[MAPIStoreMapping registerURLs:withIDs:] if needed 2012-10-12 23:28:47 -04:00
Wolfgang Sourdeau 37e8f7ca98 "preload_message_bodies" now take an additional "enum mapistore_table_type" argument 2012-10-10 10:38:25 -04:00
Wolfgang Sourdeau a7691c552b Renamed -preloadMessageBodies: to preloadMessageBodiesWithMIDs: and perform a conversion of MIDs to message keys instead of the subclass code 2012-10-06 13:01:44 -04:00
Wolfgang Sourdeau 46c82286d8 Added -childKeyFromURL: as translation method and refactored -lookupMessageByURL: and -lookupFolderByURL: to make use of it 2012-10-05 13:51:58 -04:00
Wolfgang Sourdeau 671ce26a48 struct UI8Array_r replaces struct I8Array_r 2012-10-05 09:59:45 -04:00
Wolfgang Sourdeau eca09c87cc Implemented the folder.preload_message_bodies backend op 2012-10-05 09:55:01 -04:00
Wolfgang Sourdeau 08eb4d9f84 Only fetch subfolders when they are supported 2012-09-27 19:23:56 -04:00
Wolfgang Sourdeau 2760e35f15 PidTagAccessLevel should not be set on folder objects 2012-09-26 09:26:38 -04:00
Wolfgang Sourdeau 9669cd37c4 One comment and one header added. 2012-09-18 10:12:36 -04:00
Wolfgang Sourdeau fc62d76b1f Monotone-Parent: 7c8fce0426b2ec4def5226f16a9bcf2cff5dcfb9
Monotone-Revision: 1cc99cc487a5bfdb791d4067042b904d7eb47795

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-09-07T16:46:18
Monotone-Branch: ca.inverse.sogo
2012-09-07 16:46:18 +00:00
Wolfgang Sourdeau f1c5ee15b7 Monotone-Parent: 30720cd63a96f71fe1ddecf048357f4063f4a056
Monotone-Revision: c61e2dc9a2d1575387224156c338b5517bdcbae1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-21T20:39:36
Monotone-Branch: ca.inverse.sogo
2012-08-21 20:39:36 +00:00
Wolfgang Sourdeau bde4b22ba7 Monotone-Parent: 572391072fa416635b9921d39ed76478ed762097
Monotone-Revision: 105b571703ff5c4cc1024854ef8a1d987aef2bf1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-17T19:04:57
Monotone-Branch: ca.inverse.sogo
2012-08-17 19:04:57 +00:00
Wolfgang Sourdeau fb297c913c Monotone-Parent: 1fb3121c84e0bb2773973fcfde109c7b26530951
Monotone-Revision: e2f910a1982b774a3f5dfd586d968821441f2076

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-17T17:56:25
Monotone-Branch: ca.inverse.sogo
2012-08-17 17:56:25 +00:00
Wolfgang Sourdeau 47afdfcd40 Monotone-Parent: de4fcfa81509a5dd3cc5acd2a1c6ba7c97653649
Monotone-Revision: 85e37dbc7e87a173193494e6234f460788904318

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-15T13:13:15
Monotone-Branch: ca.inverse.sogo
2012-08-15 13:13:15 +00:00
Wolfgang Sourdeau 45974ec74b Monotone-Parent: 5599b85afd7e2707325836a3b533b900d96b8b0c
Monotone-Revision: 570b17715b63da450bef9fde6d9c95288911034f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-15T01:02:08
Monotone-Branch: ca.inverse.sogo
2012-08-15 01:02:08 +00:00