app.getCurrentUserRoles and app.isCurrentUserInRole not outputting as expected

I am using Leap 9.3.3.0_37 and I have an app with both dynamic and static user roles. While I'm testing the app, I have needed to test the experience in a role I am not normally in. As part of this, I wrote some code to set section editability based on whether or not the user's role contains a certain word. It is returning a partial list of roles I am in, but it does not return roles I am hard-coded in (via the app editor) or those that I was added to using the stage action button activity (Assign Users).

Is there a workaround for this?

Here is the code I am calling:

console.log(app.getCurrentUserRoles().toString().includes("BLDG"));

It's returning:

Administrator,Record Owner,EDG Ops,Initiator,BLDG Test Responder

But it should be returning all of that and BLDG Lead (manual add, see below) and BLDG Senior Manager (dynamic).

I don't think the function was intended to return dynamically assigned roles, although I acknowledge that would/could be helpful.

We will have to review the function to insure it is behaving as originally intended.

Is there any particular reason that you are still using 9.3.3? 9.3.8 will be available within a few days and there are many great reasons to upgrade!

Hi Chris,

What's interesting is that the dynamically assigned roles DO work with the functions, but only if you dynamically add users by service call and not by the functionality on submit buttons (see screenshot).

In any case, I am not the Enterprise administrator of Leap for our organization and they are behind on recent updates. I do not know when or if we'll get 9.3.8, but I'm hopeful!