Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.34
diff -u -p -r1.34 ChangeLog
--- ChangeLog	25 Jul 2005 12:11:25 -0000	1.34
+++ ChangeLog	26 Jul 2005 12:08:07 -0000
@@ -1,3 +1,12 @@
+2005-07-26  Shakti Sen <shprasad@novell.com>
+
+	* Makefile.am: Included 'calendar' in INCLUDES and some .la in 
+	'liborg_gnome_exchange_operations_la_LIBADD'
+	* exchange-folder-permission.c: Added the functionality for 
+	'File->Permissions' menu-item for Calendar, Tasks and Contacts.
+
+	Fixes bug #231968.
+
 2005-07-25  Shakti Sen <shprasad@novell.com>
 
 	* org-gnome-exchange-operations.eplug.in: Fixed a small typo.
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- Makefile.am	25 Jul 2005 07:37:03 -0000	1.12
+++ Makefile.am	26 Jul 2005 12:08:07 -0000
@@ -1,6 +1,7 @@
 INCLUDES = -I .						\
 	-I$(top_srcdir)	                                \
 	-I$(top_srcdir)/widgets				\
+	-I$(top_srcdir)/calendar			\
 	$(EVOLUTION_MAIL_CFLAGS) 			\
 	$(CAMEL_EXCHANGE_CFLAGS)                        \
 	$(CAMEL_CFLAGS)					\
@@ -49,7 +50,11 @@ liborg_gnome_exchange_operations_la_SOUR
 liborg_gnome_exchange_operations_la_LIBADD = 		\
 	$(top_builddir)/e-util/libeutil.la 			\
 	$(top_builddir)/widgets/misc/libemiscwidgets.la		\
+	$(top_builddir)/calendar/gui/libevolution-calendar.la \
+	$(top_builddir)/mail/libevolution-mail.la \
+	$(top_builddir)/addressbook/gui/component/libevolution-addressbook.la \
 	$(CAMEL_LIBS)						\
+	$(EVOLUTION_MAIL_LIBS)				\
 	$(CAMEL_EXCHANGE_LIBS)
 
 liborg_gnome_exchange_operations_la_LDFLAGS = -module -avoid-version
Index: exchange-folder-permission.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-folder-permission.c,v
retrieving revision 1.5
diff -u -p -r1.5 exchange-folder-permission.c
--- exchange-folder-permission.c	25 Jul 2005 07:37:03 -0000	1.5
+++ exchange-folder-permission.c	26 Jul 2005 12:08:08 -0000
@@ -34,6 +34,7 @@
 #include <libedataserverui/e-source-selector.h>
 #include <mail/em-popup.h>
 #include <mail/em-menu.h>
+#include <libebook/e-book.h>
 #include "exchange-config-listener.h"
 #include "exchange-operations.h"
 #include "exchange-permissions-dialog.h"
@@ -227,37 +228,95 @@ org_gnome_exchange_menu_folder_permissio
 void
 org_gnome_exchange_menu_cal_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
-#if 0
 	ExchangeAccount *account = NULL;
 	EFolder *folder = NULL;
-	ECalModel *model = target->model;
-	ECal *ecal;
-	ecal = e_cal_model_get_default_client (model);
-	gchar *uri = e_cal_get_uri (ecal);
-	
-
-	if (target == NULL)
-		return;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
 
-	//folder = exchange_account_get_folder (account, target->target->uri);
-	//if (folder)
-	//	exchange_permissions_dialog_new (account, folder, NULL);
-#endif
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	if (model)
+		ecal = e_cal_model_get_default_client (model);
+
+	if (ecal)
+		uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 }
 
 void
 org_gnome_exchange_menu_tasks_permissions (EPlugin *ep, ECalMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	ECalModel *model = NULL;
+	ECal *ecal = NULL;
+	gchar *uri = NULL;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
+
+	if (!target)
+		return;
+
+	if (target->model)
+		model = E_CAL_MODEL (target->model);
+
+	if (model)
+		ecal = e_cal_model_get_default_client (model);
+
+	if (ecal)
+		uri = (gchar *) e_cal_get_uri (ecal);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 
 }
 
 void
 org_gnome_exchange_menu_ab_permissions (EPlugin *ep, EABMenuTargetSelect *target)
 {
+	ExchangeAccount *account = NULL;
+	EFolder *folder = NULL;
+	EBook *ebook = NULL;
+	gchar *uri = NULL;
+
+	if (!target)
+		return;
+
+	account = exchange_operations_get_exchange_account ();
+
+	if (!account)
+		return;
 
+	if (target->book)
+		ebook = E_BOOK (target->book);
+
+	if (ebook)
+		uri = (gchar *) e_book_get_uri (ebook);
+
+	if (uri)
+		folder = exchange_account_get_folder (account, uri);
+
+	if (folder)
+		exchange_permissions_dialog_new (account, folder, NULL);
 }
