ACL

Conversion des entêtes C++ (.h) en LotusScript. le toolkit est téléchargeable ici => http://www-128.ibm.com/developerworks/l ... lkits.html

ACL

Messagepar Stephane Maillard » 23 Oct 2006 à 15:22

Bonjour,

Voici la conversion d'acl.h. Les lignes entre %REM et %END REM sont des lignes que je n'arrive pas à traduire. Donc si vous savez comment faire.
Code : Tout sélectionner
Option Public

Const ACL_UNIFORM_ACCESS = &h00000001

Const ACL_LEVEL_NOACCESS = 0
Const ACL_LEVEL_DEPOSITOR = 1
Const ACL_LEVEL_READER = 2
Const ACL_LEVEL_AUTHOR = 3
Const ACL_LEVEL_EDITOR = 4
Const ACL_LEVEL_DESIGNER = 5
Const ACL_LEVEL_MANAGER = 6

Const ACL_LEVEL_HIGHRST = 6
Const ACL_LEVEL_COUNT = 7

Const ACL_LEVEL_STRINGMAX = 128

Const ACL_PRIVCOUNT = 80
Const ACL_PRIVNAMEMAX = 16
Const ACL_PRIVSTRINGMAX = (16 + 2)
Const ACL_BITPRIVBOUNT = 5
Const ACL_BITPRIVS = &h1f
Const ACL_BITPRIV_LEFT_PAREN = "("
Const ACL_BITPRIV_RIGHT_PAREN = ")"
Const ACL_SUBGROUP_LEFT_PAREN = "["
Const ACL_SUBGROUP_RIGHT_PAREN = "]"

Const ACL_FLAG_AUTHOR_NOCREATE = &h0001
Const ACL_FLAG_SERVER = &h0002
Const ACL_FLAG_NODELETE = &h0004
Const ACL_FLAG_CREATE_PARENT = &h0008
Const ACL_FLAG_CREATE_PRFOLDER = &h0010
Const ACL_FLAG_PERSON = &h0020
Const ACL_FLAG_GROUP = &h0040
Const ACL_FLAG_CREATE_FOLDER = &h0080
Const ACL_FLAG_CREATE_LOTUSSCRIPT = &h0100
Const ACL_FLAG_PUBLICREADER = &h0200
Const ACL_FLAG_PUBLICWRITER = &h0400
Const ACL_FLAG_MONITORS_DISALLOWED = &h800
Const ACL_FLAG_NOREPLICATE = &h1000
Const ACL_FLAG_ADMIN_READERAUTHOR = &h4000
Const ACL_FLAG_ADMIN_SERVER = &h8000

Const ACL_UPDATE_NAME = &h01
Const ACL_UPDATE_LEVEL = &h02
Const ACL_UPDATE_PRIVILEGES = &h04
Const ACL_UPDATE_FLAGS = &h08

Const NAMES_LIST_AUTHENTICATED = &h0001
Const NAMES_LIST_PASSWORD_AUTHENTICATED = &h0002
Const NAMES_LIST_FULL_ADMIN_ACCESS = &h0004
%REM
typedef struct {BYTE BitMask[10];} ACL_PRIVILEGES;

#define ACLIsPrivSet(privs, num)   ((privs).BitMask[num / 8] &   (1 << (num % 8)))
#define ACLSetPriv(privs, num)      ((privs).BitMask[num / 8] |=  (1 << (num % 8)))
#define ACLClearPriv(privs, num)   ((privs).BitMask[num / 8] &= ~(1 << (num % 8)))
#define ACLInvertPriv(privs, num)   ((privs).BitMask[num / 8] ^=  (1 << (num % 8)))
%END REM

Type NAMES_LIST
   NumNames As Long
   License(0 To 3) As Integer
   Authenticated As Long
End Type

Declare Function ACLLookupAccess Lib "nnotes.dll" (hAcl As Long, pNamesList As NAMES_LIST, retAccessLevel As Integer, retPrivileges As Long, retAccessFlags As Integer, rethPrivNames As Long ) As Integer
Declare Function ACLCreate Lib "nnotes.dll" (rethACL As Long) As Integer
Declare Function ACLAddEntry Lib "nnotes.dll" (hACL As Long, Byval sName As Lmbcs String, AccessLevel As Integer, Privileges As Long, AccessFlags As Integer) As Integer
Declare Function ACLDeleteEntry Lib "nnotes.dll" (hACL As Long, Byval sName As Lmbcs String) As Integer
Declare Function ACLUpdateEntry Lib "nnotes.dll" (hACL As Long, Byval sName As Lmbcs String, UpdateFlags As Integer, Byval NewName As Lmbcs String, NewAccessLevel As Integer, NewPrivileges As Long, NewAccessFlags As Integer) As Integer
%REM
STATUS LNPUBLIC ACLEnumEntries (HANDLE hACL,   void (LNCALLBACKPTR EnumFunc)(void far *EnumFuncParam,   char far *Name, WORD AccessLevel, ACL_PRIVILEGES far *Privileges, WORD AccessFlags),   void far *EnumFuncParam);
%END REM
Declare Function ACLGetPrivName Lib "nnotes.dll" (hAcl As Long, PrivNum As Integer, retPrivName As String) As Integer
Declare Function ACLSetPrivName Lib "nnotes.dll" (hAcl As Long, PrivNum As Integer, PrivName As String) As Integer
Declare Function ACLGetHistory Lib "nnotes.dll" (hAcl As Long, hHistory As Long, HistoryCount As Integer) As Integer
Declare Function ACLGetFlags Lib "nnotes.dll" (hAcl As Long, Flags As Long) As Integer
Declare Function ACLSetFlags Lib "nnotes.dll" (hAcl As Long, Flags As Long) As Integer
Declare Function ACLGetAdminServer Lib "nnotes.dll" (hList As Long, ServerName As String) As Integer
Declare Function ACLSetAdminServer Lib "nnotes.dll" (hList As Long, ServerName As String) As Integer
Si vous voyez des erreurs ou des bugs n'héstez pas à faire les corrections.
Cordialement

Stéphane Maillard
Avatar de l’utilisateur
Stephane Maillard
Lord of DominoArea
Lord of DominoArea
 
Message(s) : 8695
Inscrit(e) le : 16 Déc 2004 à 01:10
Localisation : Bretagne

Retour vers Lotus C++ API en LotusScipt