portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <d.tay...@onehippo.com>
Subject Re: Change group's name
Date Wed, 19 May 2010 17:42:20 GMT
On Wed, May 19, 2010 at 8:00 AM, curro
<franciscojavier.rosado@avarmar.com> wrote:
> Hello all,
>
>
>
> Do Someone knows how change the name to a users group easily? It's a
> requisite because into the organization change the name often. We have our
> own interface to create and manage groups with group manager, but I can not
> find how to change the name for a Principal. Each group cauld have easily
> 2000 user or more, and create new group and transfer all user may be a
> problem.
>
Changing principal names isn't supported, it requires deleting and
adding the principal with a new name
Recommend something like (perhaps i should add this API to Jetspeed):

public void changeGroupName(String oldGroupName, String newGroupName)
{
    Group group = groupManager.addGroup(newGroupName);
    List<User> usersInGroup = getUsersInGroup(oldGroupName);
    groupManager.removeGroup(oldGroupName); // will remove association
for user->group
    for (User user : usersInGroup)
    {
   	groupManager.addUserToGroup(user.getName(), newGroupName);
    }		
}

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message