Show/Hide Toolbars

Therefore Programming Interface 3.0

 

This functions decides if a User is able to archive/create a new version of a specific document. It's called every time a user tries to archive a document.

 

public int AllowArchive([in] object vUser, [in] object vIxData, [in] int nOldDocNo)

 

Arguments

 

vUser

The User, who wants to archive a document (see User).

vIxData

The Index Data of the document (see Index Data).

nOldDocNo

Contains the old Document Number if the user tries to create an new version of an existing document.

 

Return

 

Return GRANT  (= 1) if the user should be allowed to archive the document, else return NONE (= 0) or REVOKE ( = 2). If you want to use the Thereforeā„¢ Default Rights return UNKNOWN(= 9) and if that function is not implemented throw a new System.Runtime.InteropServices.NotImplementedException. This will use Thereforeā„¢ Default Rights and not call that function in future cases.

 

 

Return Value

Right

0

NONE

1

GRANT

2

REVOKE

9

UNKNOWN - Use Thereforeā„¢ Defaults

NotImplementedException

Use Thereforeā„¢ Default Rights and do not call that function again

 

 

Remarks

 

This Function is only called if the user has the corresponding Rights in Thereforeā„¢. That means AllowArchive is only called if the if the user already passed the Thereforeā„¢ Security Check and is allowed to archive a document as defined in the Thereforeā„¢ Category Rights.

 

Therefore this function can only be used add additional restrictions on a per user level, not to give a user additional rights he does not have in Thereforeā„¢.

C# Sample (Implementing the Function)

public int AllowArchive(object vUser, object vIxData, int nOldDocNo)

{

   bool bAllow = false;

   object[] oaUser = (object[])vUser;

 

      int nUserNo = (Int32)oaUser[0];

      string strUsername = (string)oaUser[1];

      string strGroupNoList = (string)oaUser[2];

 

   //DO ANYTHING -> set allow to true or false

 

   if (bAllow)

      return 1//GRANT

   

   return 2;      //REVOKE

}

C# Sample (Function not implemented - Use default Thereforeā„¢ Rights and don't call again)

public int AllowArchive(object vUser, object vIxData, int nOldDocNo)

{

   throw new NotImplementedException();

}

 

See also:

Additional Information about vUser Object

Additional Information about vIndexData Object

 

 

Ā© 2023 Therefore Corporation, all rights reserved.