GetLegalActionDefNames

설명

제공된 레코드(Entity 오브젝트)에 대해 액세스 가능한 조치 목록을 리턴합니다.

이 메소드는 EntityDef의 GetActionDefNames 메소드와 유사합니다. 그러나 이 메소드에서 리턴된 목록에는 현재 상태에서 Entity 오브젝트에 대해 수행할 수 있는 조치만이 리턴됩니다. Session 오브젝트의 EditEntity 메소드를 호출하기 전에 이 메소드를 사용하여 사용자가 레코드에 대해 적절하게 수행할 수 있는 조치를 판별할 수 있습니다.

리턴된 목록은 상태를 기본으로 허용되는 조치만 나열하며 사용자가 수행할 권한을 갖고 있는 조치로 제한됩니다. 그러나 권한 확인은 그룹 액세스 권한만을 기본으로 합니다. 대신, 조치 또는 임의의 기본 조치가 access_control 후크를 갖고 있으면 해당 후크를 사용하여 사용자가 조치를 수행할 권한을 갖고 있는지 여부를 판별하지 않습니다. 따라서, 사용자가 해당 조치 중 하나를 실행할 경우 "권한 거부" 오류 메시지가 발생할 수 있습니다.

후크 내에서 이 메소드를 호출할 경우, 사용자는 항상 현재 레코드 상태에 적절한 조치를 실행할 권한을 갖습니다.

구문

VBScript

entity.GetLegalActionDefNames 

Perl

$entity->GetLegalActionDefNames(); 
ID
설명
entity
사용자 데이터 레코드를 나타내는 Entity 오브젝트. 후크 내에서 구문에 이 부분을 생략할 경우, Entity 오브젝트가 현재 데이터 레코드에 해당한다고 가정합니다(VBScript에만 해당).
Return value
Visual Basic의 경우 문자열 배열이 포함된 Variant를 리턴합니다. 각 문자열은 적절한 조치의 이름을 포함합니다. Entity 오브젝트에 대해 어떠한 조치도 수행할 수 없는 경우, 빈 Variant 값이 리턴됩니다.

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);

  }

 } 

피드백