Location: Symbol Reference > Classes > TJwSecurityAccessControlList Class > TJwSecurityAccessControlList Methods > TJwSecurityAccessControlList.Add Method
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
TJwSecurityAccessControlList.Add Method
Pascal
function Add(AccessEntry: TJwSecurityAccessControlEntry): integer;

Add returns the index in the list where the ACE was added

Add adds an ACE instance to into the list. The ACE property ListOwner will be set to this list. 

Where the new item is inserted depends on its type: 

  1. If the ACE is a direct allow ACE it is added at the bottom of the list
  2. If the ACE is a inherited allow ACE it is added after the last deny ACE or at the top of list if no deny ACE exists
  3. If the ACE is a deny ACE it is added at the top of list
 

 

The following list shows a full access control list 

  1. deny ACE
  2. allow ACE 3 (direct)
  3. deny ACE 1 (inherited)
  4. allow ACE 2 (inherited)
The numbers shows the order the ACEs were added. 

Audit items are always added to the end of list and cannot be added to discretionary lists. 

Do not call this function without a pointer to the ACE : ACLList.Add(TJwAuditAccessControlEntry.Create(nil,[afObjectInheritAce],GENERIC_READ,aSID,False)); If the Add method raises an Exception, the TJwAuditAccessControlEntry instance is not freed. Instead use a pointer

    try
    anACE := TJwAuditAccessControlEntry.Create(nil,[afObjectInheritAce],GENERIC_READ,aSID,False)
    try
      ACLList.Add(anACE);
    except
      anACE.Free;
    end;
  except

  end;

 

Exceptions 
Description 
will be raised if aObject is nil 
will be raised if

 
will be raised if the given ACE is already in list 
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!