[evolution-kolab] CamelKolabIMAPXStore: stubbed in ACL getter/setter functions



commit aa65138d6003fe79fccd20f6c54fe07ee3b57a86
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Oct 2 14:36:55 2012 +0200

    CamelKolabIMAPXStore: stubbed in ACL getter/setter functions
    
    * new API functions for getting and setting ACL data,
      analogous to the ones for metadata
    * in contrast to the CamelIMAPXExtdStore, which uses
      hash tables for ease of data handling and lookup,
      we use GLists here which can be transformed into
      DBus strings, should we need to access the store
      API that way later on
    * the list representation is also closer to what we
      actually have on the server as well as in the UI

 src/libekolab/camel-kolab-imapx-store.c |   82 ++++++++++++++++++++++++++++++-
 src/libekolab/camel-kolab-imapx-store.h |   44 ++++++++++++++---
 2 files changed, 118 insertions(+), 8 deletions(-)
---
diff --git a/src/libekolab/camel-kolab-imapx-store.c b/src/libekolab/camel-kolab-imapx-store.c
index a4a547d..86514c3 100644
--- a/src/libekolab/camel-kolab-imapx-store.c
+++ b/src/libekolab/camel-kolab-imapx-store.c
@@ -984,7 +984,7 @@ kolab_imapx_store_delete_folder_sync (CamelStore *self,
 	                                 &tmp_err);
 	if (! ok) {
 		g_debug ("%s: removing type annotation for '%s' on server failed: %s",
-		           __func__, foldername, tmp_err->message);
+		         __func__, foldername, tmp_err->message);
 		g_error_free (tmp_err);
 	}
 
@@ -1211,6 +1211,42 @@ kolab_imapx_store_set_show_all_folders (CamelKolabIMAPXStore *self,
 	return ok;
 }
 
+static GList*
+kolab_imapx_store_get_folder_permissions (CamelKolabIMAPXStore *self,
+                                          const gchar *foldername,
+                                          gboolean myrights,
+                                          GCancellable *cancellable,
+                                          GError **err)
+{
+	g_assert (CAMEL_IS_KOLAB_IMAPX_STORE (self));
+	g_assert (foldername != NULL);
+	/* cancellable may be NULL */
+	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+
+	/* FIXME implement me */
+	g_warning ("%s()[%u] FIXME implement me", __func__, __LINE__);
+
+	return NULL;
+}
+
+static gboolean
+kolab_imapx_store_set_folder_permissions (CamelKolabIMAPXStore *self,
+                                          const gchar *foldername,
+                                          const GList *permissions,
+                                          GCancellable *cancellable,
+                                          GError **err)
+{
+	g_assert (CAMEL_IS_KOLAB_IMAPX_STORE (self));
+	/* permissions may be NULL (use to delete all permissions) */
+	/* cancellable may be NULL */
+	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+
+	/* FIXME implement me */
+	g_warning ("%s()[%u] FIXME implement me", __func__, __LINE__);
+
+	return FALSE;
+}
+
 /*----------------------------------------------------------------------------*/
 /* interface functions */
 
@@ -1432,6 +1468,8 @@ camel_kolab_imapx_store_class_init (CamelKolabIMAPXStoreClass *klass)
 	klass->resect_folder_list = kolab_imapx_store_resect_folder_list;
 	klass->get_show_all_folders = kolab_imapx_store_get_show_all_folders;
 	klass->set_show_all_folders = kolab_imapx_store_set_show_all_folders;
+	klass->get_folder_permissions = kolab_imapx_store_get_folder_permissions;
+	klass->set_folder_permissions = kolab_imapx_store_set_folder_permissions;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -1571,5 +1609,47 @@ camel_kolab_imapx_store_set_show_all_folders (CamelKolabIMAPXStore *self,
 	return ok;
 }
 
+GList*
+camel_kolab_imapx_store_get_folder_permissions (CamelKolabIMAPXStore *self,
+                                                const gchar *foldername,
+                                                gboolean myrights,
+                                                GCancellable *cancellable,
+                                                GError *err)
+{
+	CamelKolabIMAPXStoreClass *klass = NULL;
+	GList *perms = NULL;
+
+	g_return_val_if_fail (CAMEL_IS_KOLAB_IMAPX_STORE (self), FALSE);
+
+	klass = CAMEL_KOLAB_IMAPX_STORE_GET_CLASS (self);
+	perms = klass->get_folder_permissions (self,
+	                                       foldername,
+	                                       myrights,
+	                                       cancellable,
+	                                       err);
+	return perms;
+}
+
+gboolean
+camel_kolab_imapx_store_set_folder_permissions (CamelKolabIMAPXStore *self,
+                                                const gchar *foldername,
+                                                const GList *permissions,
+                                                GCancellable *cancellable,
+                                                GError *err)
+{
+	CamelKolabIMAPXStoreClass *klass = NULL;
+	gboolean ok = FALSE;
+
+	g_return_val_if_fail (CAMEL_IS_KOLAB_IMAPX_STORE (self), FALSE);
+
+	klass = CAMEL_KOLAB_IMAPX_STORE_GET_CLASS (self);
+	ok = klass->set_folder_permissions (self,
+	                                    foldername,
+	                                    permissions,
+	                                    cancellable,
+	                                    err);
+	return ok;
+}
+
 /*----------------------------------------------------------------------------*/
 /*----------------------------------------------------------------------------*/
diff --git a/src/libekolab/camel-kolab-imapx-store.h b/src/libekolab/camel-kolab-imapx-store.h
index 273dff7..2d3f722 100644
--- a/src/libekolab/camel-kolab-imapx-store.h
+++ b/src/libekolab/camel-kolab-imapx-store.h
@@ -103,11 +103,25 @@ struct _CamelKolabIMAPXStoreClass {
 	                                  gboolean show_all,
 	                                  GCancellable *cancellable,
 	                                  GError **err);
+
+	GList* (*get_folder_permissions) (CamelKolabIMAPXStore *self,
+	                                  const gchar *foldername,
+	                                  gboolean myrights,
+	                                  GCancellable *cancellable,
+	                                  GError *err);
+
+	gboolean (*set_folder_permissions) (CamelKolabIMAPXStore *self,
+	                                    const gchar *foldername,
+	                                    const GList *permissions,
+	                                    GCancellable *cancellable,
+	                                    GError *err);
 };
 
 GType camel_kolab_imapx_store_get_type (void);
 
-/* Kolab extension: set/get type for newly created folders */
+/* Kolab extensions */
+
+/* metadata: set/get type for newly created folders */
 gboolean
 camel_kolab_imapx_store_set_folder_creation_type (CamelKolabIMAPXStore *self,
                                                   KolabFolderTypeID type_id,
@@ -116,12 +130,12 @@ camel_kolab_imapx_store_set_folder_creation_type (CamelKolabIMAPXStore *self,
 KolabFolderTypeID
 camel_kolab_imapx_store_get_folder_creation_type (CamelKolabIMAPXStore *self);
 
-/* Kolab extension: set the folder context (email, calendar, contacts (defaults to email)) */
+/* metadata: set the folder context (email, calendar, contacts (defaults to email)) */
 gboolean
 camel_kolab_imapx_store_set_folder_context (CamelKolabIMAPXStore *self,
                                             KolabFolderContextID context);
 
-/* Kolab extension: get the folder type id */
+/* metadata: get the folder type id */
 KolabFolderTypeID
 camel_kolab_imapx_store_get_folder_type (CamelKolabIMAPXStore *self,
                                          const gchar *foldername,
@@ -129,28 +143,44 @@ camel_kolab_imapx_store_get_folder_type (CamelKolabIMAPXStore *self,
                                          GCancellable *cancellable,
                                          GError **err);
 
-/* Kolab extension */
+/* online-query the folder info (no update of persistent DBs) */
 CamelFolderInfo*
 camel_kolab_imapx_store_get_folder_info_online (CamelKolabIMAPXStore *self,
                                                 const gchar *top,
                                                 CamelStoreGetFolderInfoFlags flags,
                                                 GCancellable *cancellable,
                                                 GError **err);
-/* Kolab extension */
+/* rip out list of foldernames */
 GList*
 camel_kolab_imapx_store_resect_folder_list (CamelKolabIMAPXStore *self);
 
-/* Kolab extension */
+/* metadata: whether all folders are shown or non-PIM-folders are hidden */
 gboolean
 camel_kolab_imapx_store_get_show_all_folders (CamelKolabIMAPXStore *self);
 
-/* Kolab extension */
+/* metadata: whether or not to unhide PIM-folders in mail context */
 gboolean
 camel_kolab_imapx_store_set_show_all_folders (CamelKolabIMAPXStore *self,
                                               gboolean show_all,
                                               GCancellable *cancellable,
                                               GError **err);
 
+/* acl: get the permissions for a folder */
+GList*
+camel_kolab_imapx_store_get_folder_permissions (CamelKolabIMAPXStore *self,
+                                                const gchar *foldername,
+                                                gboolean myrights,
+                                                GCancellable *cancellable,
+                                                GError *err);
+
+/* acl: set (update) the permissions for a folder */
+gboolean
+camel_kolab_imapx_store_set_folder_permissions (CamelKolabIMAPXStore *self,
+                                                const gchar *foldername,
+                                                const GList *permissions,
+                                                GCancellable *cancellable,
+                                                GError *err);
+
 G_END_DECLS
 
 /*----------------------------------------------------------------------------*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]