指定されたレコード (Entity オブジェクト) のアクセス可能アクションのリストを戻します。
このメソッドは EntityDef の GetActionDefNames メソッドと似ています。ただし、このメソッドから戻されたリストには、現在の状態で Entity オブジェクトに実行できるアクションのみが含まれています。Session オブジェクトの EditEntity メソッドを呼び出す前にこのメソッドを使用すると、レコードに正当に実行できるアクションを判別できます。
状態に基づいて許可されるアクションのみのリスト作成に加え、戻されるリストを、ユーザーが実行を許可されているアクションに限定することもできます。しかし、この許可検査は、グループ アクセス権限にのみ基づきます。 そうではなく、アクションまたはベース アクションにアクセス制御フックがある場合、このフックは、ユーザーにアクションを実行する権限があるかどうかを判別するために実行されません。したがって、ユーザーがこれらのいずれかのアクションを実行するときに、「許可は拒否されました」のエラー メッセージが表示されることがあります。
このメソッドがフック内から呼び出される場合、ユーザーには常に、レコードの現在の状態に正当なすべてのアクションを実行する権限があります。
VBScript
entity.GetLegalActionDefNames
Perl
$entity->GetLegalActionDefNames();
Perl の場合は、文字列の配列への参照。
VBScript
set sessionObj = GetSession
entityDefName = GetEntityDefName
set entityDefObj = sessionObj.GetEntityDef(entityDefName)
' Search for a legal action with which to modify the record
actionDefList = GetLegalActionDefNames
For Each actionDef in actionDefList
actionDefType = entityDefObj.GetActionDefType(actionDef)
if actionDefType = AD_MODIFY Then
sessionObj.EditEntity entity, actionDef
Exit For
End If
Next
Perl
$sessionobj = $entity->GetSession();
$entitydefname = $entity->GetEntityDefName();
$entitydefobj = $sessionobj->GetEntityDef($entitydefname);
# Search for a legal action with which to modify the record
$actiondeflist = $entity->GetLegalActionDefNames();
foreach $actionname(@$actiondeflist)
{
$actiondeftype = $entitydefobj->GetActionDefType($actionname);
if ($actiondeftype eq $CQPerlExt::CQ_MODIFY)
{
$sessionobj->EditEntity($entity,$actionname);
}
}