版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014270696/article/details/70572318
def var_securityContext = adf.context.getSecurityContext()
// Check if user has a given role
if (var_securityContext.isUserInRole('ROLE_NAME'))
{
// get the current user's name
def user = var_securityContext.getUserName()
// Do something if user belongs to ROLE_NAME
}
else
{
// do something else
}