HasPermission |
Scroll |
This functions defines the rights a user has a specific Permission for an Thereforeā¢ Object (Category, Query, ...).
public void HasPermission([in] object vUser, [in] int nObjType, [in] int nObjNo, [in] int nSubObjNo, [in] int pnAccessMask) |
Arguments
vUser
The User, who wants to archive a document (see User).
nObjType
The Object Type which rights should be determined for (Category, Query, ...) - see Object Types.
nObjNo
The Number of the Object which rights should be determined for (CategoryNo, QueryNo, ...)
nSubObjNo
Only used if nObjType = 3 (Category). Contains SubCategory No.
pnAccessMask
The Rights that should be checked for the user.
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
C# Sample (Implementing the Function)
public int HasPermission(object vUser, int nObjType, int nObjNo, int nSubObjNo, int pnAccessMask)
{
bool bAllow = false;
object[] oaUser = (object[])vUser;
int nUserNo = (Int32)oaUser[0];
string strUsername = (string)oaUser[1];
string strGroupNoList = (string)oaUser[2];
if (nObjType == 3 && nObjNo == 4) //if it is for type 3 (= Category) and
{ // Category Number = 4
if (pnAccessMask & 0x00000100)
return 1; //User Has Permission to Annotate
else
return 9; //USE Thereforeā¢ RIGHTS
}
return 9; //USE Thereforeā¢ RIGHTS
}
C# Sample (Function not implemented - Use default Thereforeā¢ Rights and don't call again)
public int HasPermission(object vUser, int nObjType, int nObjNo, int nSubObjNo, int pnAccessMask)
{
throw new NotImplementedException();
}
See also: