ADF Exceptions

JBO-25186: Exception in expression “bindVariableName” of unknown type : oracle.jbo.ExprSecurityException. What can be the reason?

Problem

I have a bind variable (i.e. “bindVariableName“) defined in view object query scope. It is based on groovy expression which access ADF security context. In particular I try to verify whether user is in certain role: adf.context.securityContext.isUserInRole(“RoleName”). And get an exception:

JBO-25186: Exception in expression “IsPlanAssumptProvideAssigned” of unknown type : oracle.jbo.ExprSecurityException

Reason

Looks that ADF does not execute groovy expression if it seems to be risky in terms of security and is marked as untrusted.

Possible solution

Mark groovy expression as trusted. By default expression is treated as trusted, so simply remove attribute trustMode from the Expression tag or change to trusted:


<Variable
Name="bindVariableName"
Kind="where"
Type="java.lang.String">
<TransientExpression
Name="VariableScript"
trustMode="trusted"><![CDATA[adf.context.securityContext.isUserInRole("RoleName")]]></TransientExpression>
</Variable>

Related post – [ADF security error] Accessing the securityContext property on class oracle.adf.share.ADFContext is not permitted. What can be the reason?

ADF Version 12.2.1.0.0

About Danas Tarnauskas