Announcement Announcement Module
No announcement yet.
Simple way to test isUserInRole within expression Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple way to test isUserInRole within expression

    I was wondering if there's anything built-in to webflow allowing access to test user's roles;
    I'm aware of the "secured" attribute on a flow, but what I'm really interested in here is a way to evaluate whether a user is in a given role from an EL expression.

    Right now, I'm doing "externalContext.nativeRequest.isUserInRole('THE_R OLE')" there a better/recommended way to do this without delegating to the native request?
    ( I noticed that just using "externalContext.isUserInRole('THE_ROLE')" always returns false, regardless of whether the user is in the role or not )

    The more general scope is that I'm trying to define a decision/action state at the beginning of a flow which sends the user to a different initial view state depending on whether they are in a particular role.