cancel
Showing results for 
Search instead for 
Did you mean: 

Delete User Group - using UME API's

Former Member
0 Kudos

Hello All,

I want to delete some group(s) from particular user using UME APIu2019s.

Note: Not Default Groups like Everyone and Authenticated Users Groups

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi DEVASARATHY PANDI,

Use below code u can delete the group from the portal


IGroupFactory  gf=UMFactory.getGroupFactory();
gf.deleteGroup("unique id of the group") ;

Regards,

P.Manivannan.

Former Member
0 Kudos

Um, that deletes the group. I think the requirement was to remove the group from a user.

Former Member
0 Kudos

Hi michael,

I thought delete the group from portal

if remove the group from a user use the below code


IGroupFactory rgf = UMFactory.getGroupFactory();
rgf.removeUserFromGroup("Unique id of the user","Unique id of the group");

Regards,

P.Manivannan.

Former Member
0 Kudos

Thank you Guys!

I got it... I thought any built-in method like "remove groups" for users.

former_member192434
Active Contributor
0 Kudos

Hi

You must make use of UME API

IUserMaint user = UMFactory.getUserFactory().newUser("AAA");

user.setFirstName("BBB");

user.setLastName("CCC");

user.save();

user.commit();

//Assigning Group

String uniqueIdOfGroup = UMFactory.getGroupFactory().getGroupByUniqueName("GROUP_NAME").getUniqueID();

UMFactory.getGroupFactory().addUserToGroup(user.getUniqueID(), uniqueIdOfGroup);

IUserAccount uacc = UMFactory.getUserAccountFactory().newUserAccount("AAA", user.getUniqueID());

uacc.setPassword("pass1");

uacc.setPasswordChangeRequired(false);

uacc.save();

uacc.commit();

Hope it helps

for details check this link

IUserMaint API

http://help.sap.com/javadocs/nwce/current/se/SP5/com/sap/security/api/IUserMaint.html

Thanks

Former Member
0 Kudos

Have you checked the UME APIs? You might want to search for IUserMaint.