Show/Hide Toolbars

Therefore Programming Interface 3.0

 

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

 

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

 

Arguments

 

vUser

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

nDocNo

The Document Number the user wants to retrieve.

 

Return

 

Return GRANT  (= 1) if the user should be allowed to retrieve 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 AllowRetrieve is only called if the if the user already passed the Thereforeā„¢ Security Check and is allowed to retrieve 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 AllowRetrieve(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

}

 

VB.net Sample (Implementing the Function)

Public Function AllowRetrieve(ByVal vUser As ObjectByVal nDocNo As Integer) As Integer _ 

   Implements ITheRightsServer.AllowRetrieve

 

   Dim bAllow As Boolean

   Dim aUser As Array

   Dim nUserNo As Integer

   Dim sUserName As String

   Dim sGroupNoList As String

 

   aUser = Split(vUser)

   nUserNo = aUser(0)

   sUserName = aUser(1)

   sGroupNoList = aUser(2)

 

   'DO ANYTHING -> set allow to true or false

 

   If bAllow = True Then

      AllowRetrieve = 1      'GRANT

   Else

      AllowRetrieve = 2      'REVOKE

   End If

 

End Function

 

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

public int AllowRetrieve(object vUser, int nDocNo)

{

   throw new NotImplementedException();

}

 

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

Public Function AllowRetrieve(ByVal vUser As ObjectByVal nDocNo As Integer) As Integer _ 

    Implements ITheRightsServer.AllowRetrieve

    

    Throw New Exception("The method or operation is not implemented.")

 

End Function

 

See also:

Additional Information about vUser Object.

Ā© 2022 Therefore Corporation, all rights reserved.