機械翻訳について

現在のユーザーに関する情報の参照

adf.context.getSecurityContext()式は、セキュリティ・コンテキストへのアクセスを提供します。セキュリティ・コンテキストから、ユーザー名や特定のロールに属しているかどうかなどの現在のユーザーに関する情報にアクセスできます。

次のコードは、これらの2つの情報を参照する方法を示しています:

// Get the security context
def secCtx = adf.context.getSecurityContext()
// Check if user has a given role
if (secCtx.isUserInRole('MyAppRole')) {
  // get the current user's name
  def user = secCtx.getUserName()
  // Do something if user belongs to MyAppRole
}