ユーザーにとって正当で、アクセス制御フックが定義されていれば実行可能な、指定されたレコード (Entity オブジェクト) のアクセス可能アクションのリストを戻します。
このメソッドから戻されたリストには、現在の状態で現在のユーザーによって、Entity オブジェクトに実行できるアクションのみが含まれています。Session オブジェクトの EditEntity メソッドを呼び出す前にこのメソッドを使用すると、ユーザーがレコードに正当に実行できるアクションを判別できます。
状態に基づいて許可されるアクションのみのリスト作成に加え、戻されるリストを、ユーザーが実行を許可されているアクションに限定することもできます。
このメソッドは GetLegalActionDefNames と似ています。しかしこのメソッドはまた、ユーザーにアクションを実行する権限があるかどうかを、アクセス制御フックの各正当なアクションを確認し、ユーザーがアクセス制御を合格するかどうかを判別して決定します。アクセス制御によってユーザーがブロックされると、戻されたアクションのリスト内のユーザーにはアクションが戻されません。
このメソッドがフック内から呼び出される場合、ユーザーには常に、レコードの現在の状態に正当なすべてのアクションを実行する権限があります。
VBScript
entity.GetLegalAccessibleActionDefNames
Perl
$entity->GetLegalAccessibleActionDefNames();
VBScript
Dim EntityObj As OAdEntity Set sessionObj = GetSession Set EntityObj = sessionObj.GetEntity("Defect", "SAMPL00000001") entityDefName = EntityObj.GetEntityDefName Set entityDefObj = sessionObj.GetEntityDef(entityDefName) ' Get the legal accessible actions actionDefList = EntityObj.GetLegalAccessibleActionDefNames If IsArray(actionDefList) Then For Each actionDef in actionDefList msg2 = msg2 & " " & actionDef Next End If MsgBox "Legal accessible actions are: " & msg2
Perl
$sessionobj = $entity->GetSession(); $entitydefname = $entity->GetEntityDefName(); $entitydefobj = $sessionobj->GetEntityDef($entitydefname); # Search for a legal action with which to modify the record $actiondeflist = $entity->GetLegalAccessibleActionDefNames(); foreach $actionname(@$actiondeflist) { $actiondeftype = $entitydefobj->GetActionDefType($actionname); if ($actiondeftype eq $CQPerlExt::CQ_MODIFY) { $sessionobj->EditEntity($entity,$actionname); } }