CALDAV and read-only appointments

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CALDAV and read-only appointments

pgtaboada
Hi there,


I am playing around with milton caldav (again) because I really need to support caldav in my application. I got it up and running after a few try and errors but hit a showstopper quite soon: I have appointments that must not be modified (moved, deleted) by anyone.

Did someone here manage to make some appointments read-only?


brgds,

Papick
Reply | Threaded
Open this post in threaded view
|

Re: CALDAV and read-only appointments

bradmacnz
Hi Papick,

Thats easy, just use the AccessControlList annotation

Here's an example from the bandstand project:

     @AccessControlList
     public List<AccessControlledResource.Priviledge>
getMusicianCalendarPrivs(MusicianCalendar target, Musician currentUser) {
         System.out.println("getMusicianCalendarPrivs: " + currentUser);
         if (target.musician == currentUser) {
             Band band = target.band;
             if (band.getName().endsWith("ReadOnly")) {
                 return AccessControlledResource.READ_BROWSE;
             }
             return AccessControlledResource.READ_WRITE;
         } else {
             return null;
         }
     }

Just change the first parameter to be the type of object you want to
control access to, and the second parameter to be whatever represents a
user in your system, eg:

public List<AccessControlledResource.Priviledge>
getEventPrivs(MyCalendarEvent target, MyUser currentUser)

Note that I'm assuming you're using annotations, and that you're using
the @Users support from annotations.

Regards,
Brad


On 16/06/17 21:34, pgtaboada wrote:

> Hi there,
>
>
> I am playing around with milton caldav (again) because I really need to
> support caldav in my application. I got it up and running after a few try
> and errors but hit a showstopper quite soon: I have appointments that must
> not be modified (moved, deleted) by anyone.
>
> Did someone here manage to make some appointments read-only?
>
>
> brgds,
>
> Papick
>
>
>
> --
> View this message in context: http://milton-users.96038.n3.nabble.com/CALDAV-and-read-only-appointments-tp4026033.html
> Sent from the Milton Users mailing list archive at Nabble.com.
> _______________________________________________
> Milton-users mailing list
> [hidden email]
> http://lists.justthe.net/mailman/listinfo/milton-users

_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users
Reply | Threaded
Open this post in threaded view
|

Re: CALDAV and read-only appointments

pgtaboada
Thanks, I will give it a try.

What if I need to "veto" a change made by a client? The appointments I am dealing with must not overlap - I have collision control on my server side.

Is there any way to tell a client, that a date/ duration change was "rejected" by the server?

brgds,

Papick

Am 18.06.2017 um 22:20 schrieb bradmacnz [via Milton Users] <[hidden email]>:

Hi Papick,

Thats easy, just use the AccessControlList annotation

Here's an example from the bandstand project:

     @AccessControlList
     public List<AccessControlledResource.Priviledge>
getMusicianCalendarPrivs(MusicianCalendar target, Musician currentUser) {
         System.out.println("getMusicianCalendarPrivs: " + currentUser);
         if (target.musician == currentUser) {
             Band band = target.band;
             if (band.getName().endsWith("ReadOnly")) {
                 return AccessControlledResource.READ_BROWSE;
             }
             return AccessControlledResource.READ_WRITE;
         } else {
             return null;
         }
     }

Just change the first parameter to be the type of object you want to
control access to, and the second parameter to be whatever represents a
user in your system, eg:

public List<AccessControlledResource.Priviledge>
getEventPrivs(MyCalendarEvent target, MyUser currentUser)

Note that I'm assuming you're using annotations, and that you're using
the @Users support from annotations.

Regards,
Brad


On 16/06/17 21:34, pgtaboada wrote:

> Hi there,
>
>
> I am playing around with milton caldav (again) because I really need to
> support caldav in my application. I got it up and running after a few try
> and errors but hit a showstopper quite soon: I have appointments that must
> not be modified (moved, deleted) by anyone.
>
> Did someone here manage to make some appointments read-only?
>
>
> brgds,
>
> Papick
>
>
>
> --
> View this message in context: http://milton-users.96038.n3.nabble.com/CALDAV-and-read-only-appointments-tp4026033.html
> Sent from the Milton Users mailing list archive at Nabble.com.
> _______________________________________________
> Milton-users mailing list
> <a href="x-msg://38/user/SendEmail.jtp?type=node&amp;node=4026035&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]
> http://lists.justthe.net/mailman/listinfo/milton-users
_______________________________________________
Milton-users mailing list
<a href="x-msg://38/user/SendEmail.jtp?type=node&amp;node=4026035&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users



If you reply to this email, your message will be added to the discussion below:
http://milton-users.96038.n3.nabble.com/CALDAV-and-read-only-appointments-tp4026033p4026035.html
To unsubscribe from CALDAV and read-only appointments, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: CALDAV and read-only appointments

bradmacnz

The obvious answer is to throw a bad request exception, Milton will respond with a 400

However, Caldav supports scheduling workflow which allows semantics for proposing and accepting or rejecting times. You should look at using PARTSTAT (participation status) so you can integrate with the workflow supported by caldav clients.

https://www.greenbytes.de/tech/webdav/draft-desruisseaux-caldav-sched-04.html


On 19/06/17 09:14, pgtaboada wrote:
Thanks, I will give it a try.

What if I need to "veto" a change made by a client? The appointments I am dealing with must not overlap - I have collision control on my server side.

Is there any way to tell a client, that a date/ duration change was "rejected" by the server?

brgds,

Papick

Am 18.06.2017 um 22:20 schrieb bradmacnz [via Milton Users] <[hidden email]>:

Hi Papick,

Thats easy, just use the AccessControlList annotation

Here's an example from the bandstand project:

     @AccessControlList
     public List<AccessControlledResource.Priviledge>
getMusicianCalendarPrivs(MusicianCalendar target, Musician currentUser) {
         System.out.println("getMusicianCalendarPrivs: " + currentUser);
         if (target.musician == currentUser) {
             Band band = target.band;
             if (band.getName().endsWith("ReadOnly")) {
                 return AccessControlledResource.READ_BROWSE;
             }
             return AccessControlledResource.READ_WRITE;
         } else {
             return null;
         }
     }

Just change the first parameter to be the type of object you want to
control access to, and the second parameter to be whatever represents a
user in your system, eg:

public List<AccessControlledResource.Priviledge>
getEventPrivs(MyCalendarEvent target, MyUser currentUser)

Note that I'm assuming you're using annotations, and that you're using
the @Users support from annotations.

Regards,
Brad


On 16/06/17 21:34, pgtaboada wrote:

> Hi there,
>
>
> I am playing around with milton caldav (again) because I really need to
> support caldav in my application. I got it up and running after a few try
> and errors but hit a showstopper quite soon: I have appointments that must
> not be modified (moved, deleted) by anyone.
>
> Did someone here manage to make some appointments read-only?
>
>
> brgds,
>
> Papick
>
>
>
> --
> View this message in context: http://milton-users.96038.n3.nabble.com/CALDAV-and-read-only-appointments-tp4026033.html
> Sent from the Milton Users mailing list archive at Nabble.com.
> _______________________________________________
> Milton-users mailing list
> <a href="x-msg://38/user/SendEmail.jtp?type=node&amp;node=4026035&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]
> http://lists.justthe.net/mailman/listinfo/milton-users
_______________________________________________
Milton-users mailing list
<a href="x-msg://38/user/SendEmail.jtp?type=node&amp;node=4026035&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users



If you reply to this email, your message will be added to the discussion below:
http://milton-users.96038.n3.nabble.com/CALDAV-and-read-only-appointments-tp4026033p4026035.html
To unsubscribe from CALDAV and read-only appointments, click here.
NAML



View this message in context: Re: CALDAV and read-only appointments
Sent from the Milton Users mailing list archive at Nabble.com.


_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users


_______________________________________________
Milton-users mailing list
[hidden email]
http://lists.justthe.net/mailman/listinfo/milton-users