Obtain userGroup (String)

Good morning.

I wonder if there is any method to obtain for the current user, his group.

I looked in the forum but I didn´t found nothing.

Thank you in advance. Kind regards

Hello,

at the beginning of the Java class inject UserSession
@Inject
private UserSession userSession;

and then use something like this to get a string:
User currentUser = userSession.getCurrentOrSubstitutedUser();
String userGroup = currentUser.getGroup().getName();

Using getCurrentOrSubstitutedUser() because user can be substituted.
This will give you Access Group. Not Roles, and not BPROC user groups, these are in a different entity.
You may also want to check the multitenancy feature, depending on what you want to accomplish.

Kind regards,
Mladen