Revision 8434
Added by Jing Tao about 11 years ago
src/edu/ucsb/nceas/metacat/authentication/AuthFile.java | ||
---|---|---|
413 | 413 |
* Add a group into the file |
414 | 414 |
* @param groupName the name of group |
415 | 415 |
*/ |
416 |
public void addGroup(String groupName) throws AuthenticationException{ |
|
416 |
public void addGroup(String groupName, String description) throws AuthenticationException{
|
|
417 | 417 |
if(groupName == null || groupName.trim().equals("")) { |
418 | 418 |
throw new AuthenticationException("AuthFile.addGroup - can't add a group whose name is null or blank."); |
419 | 419 |
} |
420 | 420 |
if(!groupExists(groupName)) { |
421 | 421 |
if(userpassword != null) { |
422 | 422 |
userpassword.addProperty(GROUPS+" "+GROUP+AT+NAME, groupName); |
423 |
if(description != null && !description.trim().equals("")) { |
|
424 |
userpassword.addProperty(GROUPS+SLASH+GROUP+"["+AT+NAME+"='"+groupName+"']"+" "+DESCRIPTION, description); |
|
425 |
} |
|
423 | 426 |
//userpassword.reload(); |
424 | 427 |
} |
425 | 428 |
} else { |
Also available in: Unified diff
Add a description element for the group.