I'm stuck designing URIs for a many-to-many relationship between users and other resources. Specifically I'm having difficulty predicting the consequences of different approaches.
Given a resources types user
and widget
(user
represents a registered user), authenticated (logged-in) users have write access to all widgets and guests have read access. The user-widget relation also has data (eg. number of edits) which ideally should also be readable (thus addressable) by guests (and, as Lèse points out below, other users). Examples use integers for unique identifiers for the sake of clarity.
Guests can view widget #12 at
/widgets/12
What are the implications of various possible URIs for authenticated user #34 to read/write widget #12, and optionally for a guest to read the relational data between the two? (Don't worry about giving a comprehensive answer, any observations for or against specific options would also be very valuable).
/widgets/12
(user is implicit based on authentication, no way for guest to specify user-widget relation)
/users/34/widgets/12
(both sides of the relation explicit, implicit hierarchy between resources)
/users/34/widgets/12 and /widgets/12/users/34
(same, without hierarchy)
/user-widget/34,12
(relation as resource, explicit but possibly more than the user needs to know)
I'm happy to give more detail or add other people's URI suggestions. Just comment if you want me to add anything.