CardDAV read only issue

1,680 बार देखा गया
नहीं पढ़े गए पहले मैसेज पर जाएं

nick

नहीं पढ़ी गई,
14 जून 2011, 12:47:29 pm14/6/11
ईमेल पाने वाला SabreDAV Discussion
I set the CardDAV permissions to read-only. When I update a contact in
my address book, it keeps sending PUT requests (which correctly get
denied) but it never reverts the change, just keeps sending denied PUT
requests forever until I update the card on the server. Is there a
response that not only denies a PUT request but also reverts the
change the user is trying to make?

Evert Pot

नहीं पढ़ी गई,
14 जून 2011, 1:14:29 pm14/6/11
ईमेल पाने वाला sabredav...@googlegroups.com
Hi Nick,

Judging from how iCal works (which is where most of my experience lies) the best way to go about this, is to actually let the PUT request go through, but fully ignore it.

iCal will do PUT requests for updates, and then instantly do a GET request to see how the server actually stored the event. I would guess that Addressbook.app would probably have the same behaviour.

Evert

tv123

नहीं पढ़ी गई,
7 अक्तू॰ 2012, 9:47:22 am7/10/12
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
I assume if I just comment out the write array in the ACL-Method of AddressBook.php it globally makes all address books read-only.

public function getACL() {

        return array(
            array(
                'privilege' => '{DAV:}read',
                'principal' => $this->addressBookInfo['principaluri'],
                'protected' => true,
            ),
//make this addressbook service read only
            /*array(
                'privilege' => '{DAV:}write',
                'principal' => $this->addressBookInfo['principaluri'],
                'protected' => true,
            ),*/

        );

    }

This would work for me, because I will feed/update the address book via database access from another web application. That way I can provide a read-only copy of my web based address book for CardDav Clients.
Is there a better way of doing this, or is this a good solution?

Thanks and best

tv

On Saturday, October 6, 2012 11:18:23 PM UTC+2, tv123 wrote:
Hi, Have you been able to get this going? I just would like to make my carddav readonly, but don't know how to do it. could you give me a hint?

tv123

Evert Pot

नहीं पढ़ी गई,
7 अक्तू॰ 2012, 11:17:21 am7/10/12
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
Hi!

On Oct 7, 2012, at 3:47 PM, tv123 <tob...@vielmetter.com> wrote:

> I assume if I just comment out the write array in the ACL-Method of AddressBook.php it globally makes all address books read-only.
>
> public function getACL() {
>
> return array(
> array(
> 'privilege' => '{DAV:}read',
> 'principal' => $this->addressBookInfo['principaluri'],
> 'protected' => true,
> ),
> //make this addressbook service read only
> /*array(
> 'privilege' => '{DAV:}write',
> 'principal' => $this->addressBookInfo['principaluri'],
> 'protected' => true,
> ),*/
>
> );
>
> }
>
> This would work for me, because I will feed/update the address book via database access from another web application. That way I can provide a read-only copy of my web based address book for CardDav Clients.
> Is there a better way of doing this, or is this a good solution?

This will block:

Updating the addressbook
Creating new cards

but not :

Updating existing cards

To do that, you need to do the same in Sabre_CardDAV_Card.

Note that, like I said earlier in the thread.. clients may not like this.. especially older ones. So give it a shot I'd say :)

Evert

tv123

नहीं पढ़ी गई,
7 अक्तू॰ 2012, 2:46:04 pm7/10/12
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
Thanks for the hint! I have done so and it seems all to work fine. I am using Contacts.app in Mountain Lion mostly, which seems to handle this fine.
The other approach i had was to do not actually execute the changes in the backend. but that would still show the changes in the clients, which I thought was to confusing for the users.

Anyways, this way I can perfectly get it working, at least for the current version of contacts.app in ML.

Thanks again!

tv

tv123

नहीं पढ़ी गई,
8 अक्तू॰ 2012, 3:35:13 pm8/10/12
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
maybe somebody can give me a hint again. After implementing the synchronization between the sabredav carddav servers database and the database of my web based address book, i had also to increase the ctag value of the address book in order for the client to realize that there has been a change to the servers data. so far everything was working until i tested the following:

when i synchronize the whole address book with roughly 7000 contacts, the  client does not synchronize anymore. it shows a little explanation mark next to the carddav address book which sais "The operation couldn’t be completed. (CoreDAVErrorDomain error 1.)" when i click on it.

Console throws several also errors which i will put at the end of this message. as mentioned earlier, I am using contacts.app in Mountain Lion Mac OS X.

can anyone give me a hint how to debug this, meaning where to look to find out what the problem is?

thanks again for all your help so far!

tv

08.10.12 18:46:25,667 Contacts[5367]: -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.
08.10.12 18:46:28,742 Contacts[5367]: Process com.apple.AddressBook deleting 590 contacts
08.10.12 18:46:36,303 Contacts[5367]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 18:47:01,282 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 18:47:03,088 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 2.81 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 21:15:38,285 Contacts[5367]: [CardDAVPlugin-ERROR] CardInfoFromVCardData(): Ignored vCard Joe Schmoe:/sabredav/addressbookserver.php/addressbooks/admin/default/ABCD5073262bdc4cd8.82020864.vcf because ABPerson create failed. VCard: "BEGIN:VCARD
VERSION:3.0
UID:ABCD5073262bdc4cd8.82020864
REV:20121008T121451Z
N:Schmoe;Joe;;;
FN:Joe Schmoe
item1.EMAIL;type=INTERNET:j...@baramba.de 
item1.X-ABLabel:PRIVATE
EMAIL;type=INTERNET;type=WORK:Joe.S...@something.ab.cd
TEL;type=HOME;type=VOICE;type=pref:+10049 30 21 30 12 89
TEL;type=WORK;type=VOICE:+1030-1213-123-51, general 0049 [30] 1234 19 0
TEL;type=OTHER;type=VOICE:+1cell 0049 119 11 41 53 9 .
TEL;type=OTHER;type=FAX:+10049 [30] 1234 59 99 fax
TEL;type=WORK;type=VOICE:+1030-243-123-11, general 0049 [30] 1111 57 0
TEL;type=OTHER;type=VOICE:+1cell 0049 179 12 34 56 7 .
TEL;type=OTHER;type=FAX:+10049 [30] 1234 59 99 fax
ADR;type=OTHER;type=pref:;;Abercstreet Str 33
;Berlin;;D 10437;GERMANY
ADR;type=OTHER:;;Assistant \n Institute for Something \Somestreet 9;Berlin;;D 10117;GERMANY
item2.X-ABLabel:SVLAPDB
END:VCARD"
08.10.12 21:15:38,856 Contacts[5367]: [CardDAVPlugin-ERROR] Error in _handleAddsOrModifies:removes:inFolderWithURL: -[__NSCFConstantString characterAtIndex:]: Range or index out of bounds
08.10.12 21:15:38,858 Contacts[5367]: [CardDAVPlugin-ERROR] -_handleAddsOrModifies:http://admin@localhost:80/sabredav/addressbookserver.php/addressbooks/admin/default/ Error Domain=CoreDAVErrorDomain Code=1 "The operation couldn’t be completed. (CoreDAVErrorDomain error 1.)"

Evert Pot

नहीं पढ़ी गई,
8 अक्तू॰ 2012, 3:43:39 pm8/10/12
ईमेल पाने वाला sabredav...@googlegroups.com
First guess:

Your VCard is not UTF-8 encoded. SabreDAV assumes that the backend delivers valid UTF-8.

I didn't see any special characters, so did you censor out some umlauts or estzets?

Evert
> --
> You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/sabredav-discuss/-/m9vsgqIO7DAJ.
> To post to this group, send email to sabredav...@googlegroups.com.
> To unsubscribe from this group, send email to sabredav-discu...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sabredav-discuss?hl=en.

tv123

नहीं पढ़ी गई,
8 अक्तू॰ 2012, 4:23:27 pm8/10/12
ईमेल पाने वाला sabredav...@googlegroups.com
Thanks Evert! that is possible, since the Data is coming from a Database and there is information that database that has been imported from several sources such as Filemaker DB etc. 

I've checked in Sabredav how it makes sure that everything is UTF-8 and have implemented that:
function SabreEnsureUTF8($input) {
    $encoding = mb_detect_encoding($input , array('UTF-8','ISO-8859-1'), true);
    if ($encoding === 'ISO-8859-1')
        return utf8_encode($input);
    else
        return $input;
}

Unfortunately that hasn't done the trick. I am still researching on how to get rid or how to convert all characters, that are non UTF-8 but I haven't found a solution yet. I'll get back as soon as I know more.

Thanks again and all best

tv

Evert Pot

नहीं पढ़ी गई,
8 अक्तू॰ 2012, 4:33:56 pm8/10/12
ईमेल पाने वाला sabredav...@googlegroups.com
If this is the problem, it goes indeed a bit beyond the scope of this list.

Perhaps its cp-1252, but don't blindly convert the character sets. First do the analysis of your source data.

Evert


tv123

नहीं पढ़ी गई,
8 अक्तू॰ 2012, 4:50:35 pm8/10/12
ईमेल पाने वाला sabredav...@googlegroups.com
Ooops, I found out that some of the data had some "\n" that were intepreted as returns. so it needet some $value = str_return("\n",'\n',$value);
I guess I have to do some more cleanup in order to put synchronize the address book to carddav.

Thanks again for the hint in the right direction!

Best

tobias

tv123

नहीं पढ़ी गई,
9 अक्तू॰ 2012, 4:29:42 am9/10/12
ईमेल पाने वाला sabredav...@googlegroups.com
So now I was able to fix all of the errors concerning the content of the cards and everything seems to work as intended. Thanks again for all your great help and your work on sabredav Evert Pot!

I am still struggling with another problem: performance of the client. 
I have roughly 7000 contacts, which seem to be a lot for the contacts.app in ML. updating the address book, it regularly freezes and freezes other applications that rely on address information such as Skype and mail.app with it.
I guess this is a pure client problem and has nothing to do with sabredav... but I thought it wouldn't hurt to get a second opinion. maybe there is something i can do from the server side, to make the client more responsive, even with thousands of addresses?

if anybody has an idea, it would be very appreciated.

thanks again and all best

tv

here some console output from the contacts.app while updating the address book:
08.10.12 23:28:16,108 Contacts[6872]: *** -[IADomainCache init]: IA domains cache is out of date.
08.10.12 23:28:46,708 Contacts[6872]: Process com.apple.AddressBook deleting 6125 contacts
08.10.12 23:28:56,916 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:29:01,910 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 5.99 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:29:06,518 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:29:13,423 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:29:15,699 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:29:17,113 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 2.41 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:29:26,273 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:29:26,862 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 1.59 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:29:27,954 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:29:38,387 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:29:38,703 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:29:41,563 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 3.86 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:29:43,008 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:29:53,770 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:29:57,008 WindowServer[102]: disable_update_likely_unbalanced: UI updates still disabled by application "Contacts" after 15.00 seconds (server forcibly re-enabled them after 1.00 seconds). Likely an unbalanced disableUpdate call.
08.10.12 23:30:02,529 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 20.52 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:30:08,404 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:30:21,593 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:30:26,815 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:30:28,050 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 7.46 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:30:29,753 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:30:36,154 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:30:43,753 WindowServer[102]: disable_update_likely_unbalanced: UI updates still disabled by application "Contacts" after 15.00 seconds (server forcibly re-enabled them after 1.00 seconds). Likely an unbalanced disableUpdate call.
08.10.12 23:30:56,349 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:30:58,198 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 29.45 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:31:00,741 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:31:11,142 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:31:14,741 WindowServer[102]: disable_update_likely_unbalanced: UI updates still disabled by application "Contacts" after 15.00 seconds (server forcibly re-enabled them after 1.00 seconds). Likely an unbalanced disableUpdate call.
08.10.12 23:31:30,893 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:31:43,493 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:32:00,098 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 60.36 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:32:01,939 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:32:04,674 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:32:15,938 WindowServer[102]: disable_update_likely_unbalanced: UI updates still disabled by application "Contacts" after 15.00 seconds (server forcibly re-enabled them after 1.00 seconds). Likely an unbalanced disableUpdate call.
08.10.12 23:32:26,724 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:32:45,905 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:33:02,365 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:33:19,397 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:33:37,113 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:33:53,102 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:34:13,787 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:34:33,752 Contacts[6872]: Error, could not create MachMessagePort for com.apple.AddressBook.abd
08.10.12 23:34:47,556 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 166.62 seconds (server forcibly re-enabled them after 1.00 seconds)
08.10.12 23:34:50,301 WindowServer[102]: CGXDisableUpdate: UI updates were forcibly disabled by application "Contacts" for over 1.00 seconds. Server has re-enabled them.
08.10.12 23:35:04,302 WindowServer[102]: disable_update_likely_unbalanced: UI updates still disabled by application "Contacts" after 15.00 seconds (server forcibly re-enabled them after 1.00 seconds). Likely an unbalanced disableUpdate call.
08.10.12 23:36:45,511 WindowServer[102]: reenable_update_for_connection: UI updates were finally reenabled by application "Contacts" after 116.21 seconds (server forcibly re-enabled them after 1.00 seconds)



Steffen Weber

नहीं पढ़ी गई,
6 मार्च 2013, 9:58:39 am6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
Am Sonntag, 7. Oktober 2012 17:17:28 UTC+2 schrieb Evert Pot:
> [...]

>
> This would work for me, because I will feed/update the address book via database access from another web application. That way I can provide a read-only copy of my web based address book for CardDav Clients.
> Is there a better way of doing this, or is this a good solution?

This will block:

Updating the addressbook
Creating new cards

but not :

Updating existing cards

To do that, you need to do the same in Sabre_CardDAV_Card.

Note that, like I said earlier in the thread.. clients may not like this.. especially older ones. So give it a shot I'd say :) 
 
I've adjusted the "getACL" methods as mentioned above in the following files:

Sabre\CardDAV\AddressBook.php
Sabre\CardDAV\Card.php
Sabre\CardDAV\UserAddressBooks.php

Now the Contacts app in iOS 6.1.2 hides the "+" button for adding new contacts (fine). But I still see an "edit" button for editing existing contacts (actually saving them fails silently). Is it expected behaviour (i.e. a bug in iOS) that the "edit" button is still shown or am I doing something wrong?

Thanks,
Steffen

Tobias Vielmetter

नहीं पढ़ी गई,
6 मार्च 2013, 10:08:43 am6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
iOS is consolidating all addresses in one app (addresses from your CardDAV server, from your phone, from iCloud etc.). If you change an address, that is read only, I have learned that it is usually added/changed to/on your default system, eg. the phone addresses or the address on iCloud.
So I would think this is normal, and your changed get saved, just not to the read only system...
Does that make sense to you?

Best,

Tobias


--
You received this message because you are subscribed to a topic in the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sabredav-discuss/K9fVdizwZdg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to sabredav-discu...@googlegroups.com.

To post to this group, send email to sabredav...@googlegroups.com.

Steffen Weber

नहीं पढ़ी गई,
6 मार्च 2013, 12:08:19 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
That makes sense, thanks!

Evert, what about adding a new boolean field "readonly" to the "addressbooks" database table? Depending on its value the three mentioned "getACL" methods could return a different value. If you agree with that proposal then I could implement this and create a pull request.

Thanks,
Steffen

Evert Pot

नहीं पढ़ी गई,
6 मार्च 2013, 12:13:32 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
Hi Steffen,

On Mar 6, 2013, at 5:08 PM, Steffen Weber <steffe...@gmail.com> wrote:

> That makes sense, thanks!
>
> Evert, what about adding a new boolean field "readonly" to the "addressbooks" database table? Depending on its value the three mentioned "getACL" methods could return a different value. If you agree with that proposal then I could implement this and create a pull request.

This doesn't make a ton of sense to me.. Because there's no way to alter this setting by a user, and if an address book is read-only by default.. there's no way to get contacts in there.

So because of this, I feel that anyone who needs this will always run some kind of custom solution, and that's also where this belongs..

Evert

Steffen Weber

नहीं पढ़ी गई,
6 मार्च 2013, 1:25:36 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com, nbout...@gmail.com
Am Mittwoch, 6. März 2013 18:13:32 UTC+1 schrieb Evert Pot:
Hi Steffen,

On Mar 6, 2013, at 5:08 PM, Steffen Weber <steffe...@gmail.com> wrote:

> That makes sense, thanks!
>
> Evert, what about adding a new boolean field "readonly" to the "addressbooks" database table? Depending on its value the three mentioned "getACL" methods could return a different value. If you agree with that proposal then I could implement this and create a pull request.

This doesn't make a ton of sense to me.. Because there's no way to alter this setting by a user, and if an address book is read-only by default.. there's no way to get contacts in there.

My use-case is a shared address book that is automatically populated with data from an external source. That's how contacts get in there. All the contacts already exist and I just want to make them available via CardDAV. We currently use OpenLDAP for this but CardDAV seems to be the way forward (for example it uses HTTP and is therefore not blocked by stupid firewalls).

So because of this, I feel that anyone who needs this will always run some kind of custom solution, and that's also where this belongs..

I agree, it's probably too specific.

Do you have a suggestion how such a "read-only" address book should be implemented without support in SabreDAV itself? I have installed SabreDAV via PHP Composer and therefore want to avoid modifying its source directly. It would be better to extend some classes. But the classes of the three mentioned "getACL" methods are instantiated directly (via "new XY") and therefore cannot be easily replaced. Or am I missing something obvious?

Thanks,
Steffen

Evert Pot

नहीं पढ़ी गई,
6 मार्च 2013, 1:28:53 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com
> I agree, it's probably too specific.
>
> Do you have a suggestion how such a "read-only" address book should be implemented without support in SabreDAV itself? I have installed SabreDAV via PHP Composer and therefore want to avoid modifying its source directly. It would be better to extend some classes. But the classes of the three mentioned "getACL" methods are instantiated directly (via "new XY") and therefore cannot be easily replaced. Or am I missing something obvious?

Yea, you kinda need to traverse the tree a little bit.
You will need to subclass:

Sabre\CardDAV\Card
Sabre\CardDAV\AddressBook
Sabre\CardDAV\UserAddressBooks
Sabre\CardDAV\AddressBookRoot

It's a bit annoying ;) but the changes are small. The last one (the root) is instantiated by yourself.

Evert

Steffen Weber

नहीं पढ़ी गई,
6 मार्च 2013, 1:48:20 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com
So I would have to overwrite the following 7 methods:

Sabre\CardDAV\AddressBookRoot
- getChildForPrincipal

Sabre\CardDAV\UserAddressBooks
- getChildren
- getACL

Sabre\CardDAV\AddressBook
- getChild
- getChildren
- getACL

Sabre\CardDAV\Card
- getACL

I agree that the one-time effort is small. But I'll have to constantly adapt these methods to upcoming changes in SabreDAV. That smells and that's why I asked if there is another solution. ;)

Not yet sure that I'll do, but thanks for the helpful replies!

Steffen

Evert Pot

नहीं पढ़ी गई,
6 मार्च 2013, 2:03:15 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com
>
> So I would have to overwrite the following 7 methods:
>
> Sabre\CardDAV\AddressBookRoot
> - getChildForPrincipal
>
> Sabre\CardDAV\UserAddressBooks
> - getChildren
> - getACL
>
> Sabre\CardDAV\AddressBook
> - getChild
> - getChildren
> - getACL
>
> Sabre\CardDAV\Card
> - getACL
>
> I agree that the one-time effort is small. But I'll have to constantly adapt these methods to upcoming changes in SabreDAV. That smells and that's why I asked if there is another solution. ;)

Well thats why you sub-class and don't mess around with any supplied code ;)

Then the only times you are affected by a change, is when I break BC. I only do that in versions where the second number changes (1.8 -> 1.9), and whenever I do I document in high detail how you may be affected. In 2012 there were 3 of these 'major' updates.

See the wiki:

http://code.google.com/p/sabredav/wiki/Introduction?tm=6

Chapter : Developer Guide, Upgrading from an older version.


Evert

mbiebl

नहीं पढ़ी गई,
6 मार्च 2013, 5:44:57 pm6/3/13
ईमेल पाने वाला sabredav...@googlegroups.com
I had basically the same use case and used exactly this approach. I'm populating the database from an Active Directory and provide shared, read-only addressbooks to users based on in which AD/LDAP group they are.

Works rather nicely so far.
 

Steffen Weber

नहीं पढ़ी गई,
7 मार्च 2013, 9:18:17 am7/3/13
ईमेल पाने वाला sabredav...@googlegroups.com
That looks great, thanks! :)
सभी प्रषकों को उत्तर दें
लेखक को उत्तर दें
आगे भेजें
0 नया मैसेज