Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

UME API : delete user from a group

Hello,

I try this :

IGroup grp2 = UMFactory.getGroupFactory().getGroupByUniqueName(im_group);

boolean check2 = false;

if ( grp2.isUserMember(epUser.getUniqueID(), check2))

{

grp2.removeGroupMember(epUser.getUniqueID());

}

But exception says :

0#0#Error##Plain###com.sap.security.api.UMRuntimeException: Maint method remove attribute cannot be used because the principal is not mutable!

Former Member
replied

Hi,

You can try:

UMFactory.getGroupFactory().removeUserFromGroup(epUser.getUniqueID(), im_group);

If you're going to remove a large number of users from the group use:

IGroup grp1 = UMFactory.getGroupFactory().getMutableGroup(im_group);
grp1.removeUserMember("<uniq-id1>");
grp1.removeUserMember("<uniq-id2>");
grp1.removeUserMember("<uniq-id3>");
grp1.save();
grp1.commit(); // update this group

also you can check <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3641e490-0201-0010-c68f-e51221925714">this</a>.

Best Regards,

Avishai Zamir

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question