For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hello All,
I'm trying to fetch the current user role in Order Management extensions (on Save Button) using groovy script so that I can perform specific set of actions. I tried below code but getting error. Can anyone pleasehelp me on this?
Code:
def secCtx = adf.context.getSecurityContext()
if (secCtx.isUserInRole('Order Manager')) {
return true
}
else {
return false
}
Error: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: groovy.lang.MissingPropertyException, msg=No such property: adf for class: ExID300000196161920__19. (DOO-2685874)
Comment
Please refer to Implement Security section which has an example on how to check if the user has a specific role granted or not through an extension.
Average Rating:



1 rating
|
Sign in to rate this
Hi,
You can use the following syntax which has worked in our case
if (context.isUserInRole('XXX_SO_ORDER_MANAGEMENT')) return;
This will validate if the logged in user is having the role (you need to pass the role code.
Try and let me know if it works.
Regards.
Ramadoss
Be the first to rate this
|
Sign in to rate this