Get assigned roles and access Profiles for identity via beanshell

Via beanshell in a rule where we have the identity object or the idnruleutil, whats the best way to get roles and access profiles assigned to an identity?

I know i can get entitlements via idnruleutil using the account object and get the raw account attribute value of the entitlement attribute, but whats the best way to get assigned roles and access profiles?

I know we have the legacy java/iiq methods of getRoleAssignments() or getBundles() that return object type of Bundle, but im assuming you dont want us using those.

You can try using the below API to fetch the roles assigned to an identity

The JSON response has a lot of details including access profile names so you can filter on the required fields.

Thanks for the response, I’m really looking for a way via beanshell, like from a generic or identity attribute rule. Since we cant make a REST call out from a rule like that, looking for an internal beanshell method of getting this information.

In that case using IDNRuleUtil as you mentioned above is your best bet.