Show/Hide Toolbars

Therefore Programming Interface 3.0

 

This functions decides if a User is able to delete a specific document. It's called every time a user tries to delete a document.

 

public int AllowDelete([in] object vUser, [in] int nDocNo)

 

Arguments

 

vUser

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

nDocNo

The Document Number the user wants to delete.

 

Return

 

Return GRANT  (= 1) if the user should be allowed to delete the document, else return NONE (= 0) or REVOKE ( = 2). If you want to use the Thereforeā„¢ Default Rights return UNKNOWN(=3) 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 AllowDelete is only called if the if the user already passed the Thereforeā„¢ Security Check and is allowed to delete the 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 AllowDelete(object vUser, int nDocNo)

{

   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 AllowDelete(object vUser, int nDocNo)

{

   throw new NotImplementedException();

}

 

See also:

Additional Information about vUser Object

Ā© 2023 Therefore Corporation, all rights reserved.