jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "UserManagement" by gayatrimehra
Date Wed, 03 Apr 2013 21:42:51 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "UserManagement" page has been changed by gayatrimehra:
http://wiki.apache.org/jackrabbit/UserManagement?action=diff&rev1=5&rev2=6

  session.save();
  
  }}}
- 	
  
+ --->> fetch members from a group
+ {{{
+ final List<String> members = new ArrayList<String>();
+ final UserManager userManager = ((JackrabbitSession) session)
+ 					.getUserManager();
+ 			final Authorizable auth2 = userManager.getAuthorizable(groupName);
+ 			
+ 			if (auth2.isGroup()) {
+ 				Group group = (Group) auth2;
+ 				Iterator<Authorizable> iter = group.getMembers();
+ 
+ 								while (iter.hasNext()) {
+ 					Authorizable auth = iter.next();
+ 
+ 					if (!auth.isGroup()) {
+ 
+ 						members.add(auth.getID());
+ 
+ 					}
+ 
+ 				}
+ 
+ }}}
  === TODO ===
  
   * list users

Mime
View raw message