@Target(value=METHOD) @Retention(value=RUNTIME) public @interface AccessControlList
The method must have at least 2 parameters:
@Authenticate methodMilton will search up the object hierarchy to find a @AccessControlList method. The
first one found which returns a non-null value will be used. Returning null
indicates the method is not able to determine an ACL, so Milton will continue the search up the parents.
So if a request is made to a URL like this: /users/brad/calenars/cal1
Then if cal1 represents an instance of a MyCalendar, and @Authenticate returned
an instance of MyUser, then you should have a method like this:
@AccessControlList public List{@literal <}AccessControlledResource.Priviledge{@literal >} getUserPrivs(MyCalendar target, MyUser currentUser)
But if you want to apply permissions at a higher level, say at the level of the user object, and lets say that "brad" is an instance of a MyUser object then you would have this:
{@literal @}AccessControlList public List{@literal <}AccessControlledResource.Priviledge{@literal >} getUserPrivs(MyUser target, MyUser currentUser)