jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: UserManager API strangeness (II)
Date Thu, 11 Mar 2010 11:38:13 GMT
Hi,

On 11.03.2010 12:06, Angela Schreiber wrote:
> Felix Meschberger wrote:
>> Hi
>>
>> another thing striked me looking at the UserManager API: there are 4
>> create methods:
>>
>>    createGroup(Principal);
>>    createGroup(Principal, String);
>>    createUser(String userID, String password, Principal principal,
>>                     String intermediatePath);
>>    createUser(String userID, String password;
>>
>> I am missing a method
>>
>>    createGroup(String groupName);
>>
>> in this picture. Is there a reason to not have such a method ?
> 
> yes. what should that groupName reflect?
> if you expect this to be the displayName you should
> use 'setProperty' instead.
> if you expect this to be the ID -> for groups the
> ID is generated based on the principalName which the
> following valiation:
> 
> - principalName already present with another user/group
>   -> attempt to create a duplicate -> fails
> 
> - principalName collides with a UserID in those cases
>   where principalName != userID -> generation of a unique
>   id for the group since the principalName is valid
> 
> - all other cases: principalName is the same as the groupID.
> 

Thanks for the information.

For a hypothetical createGroup(String groupName) method, I would assume
this to behave similar as createUser(String userName, String password):
The groupName is used as the Group ID and a collision with an existing
Authorizable ID would be considered an error.

Regards
Felix

Mime
View raw message