[Cosmo-dev] <administrator/> cmp tag
Travis Vachon
travis at osafoundation.org
Fri Jan 12 15:01:16 PST 2007
Hi folks
When I was making additions to the CMP protocol for the struts->
spring work I added an <administrator> tag to the CMP representation
of a user. <administrator> works differently than tags like
<firstName> in the following way:
When a user representation omitting <firstName> is PUT to /cmp/user/
{username} for an existing user {username} the server simply does not
change the user's first name. In contrast, when a user representation
omitting <administrator/> is PUT to /cmp/user/{username} the server
interprets this as a request to make the user NOT an administrator.
This break in symmetry between tags means that clients need to
"remember" administrator status. This isn't really ideal for a client
that _just_ wants to change a property, since it first needs to fetch
a representation, make sure it remembers administrator status, and
make sure it includes <administrator/> when it puts the representation.
This also means it is easy for a client to mistakenly take away his
or her own administrator status, which would then require contacting
another administrator to rectify.
To fix this, we have two options:
a) instead of the presence of <administrator/> signifying
administrator status, we could make <administrator> a tag containing
a boolean value that behaves like the other tags
or
b) add a <nonAdministrator> tag. The presence of this tag would make
a user not an administrator, while the presence of <administrator>
would make a user an administrator.
In either case, omitting any of these tags would not have any effect
on the user.
If there are no preferences, I'm going to go for a), probably in the
0.7 time frame, though if I find a few extra minutes I may try to get
this in sooner.
-Travis
More information about the cosmo-dev
mailing list