Location: Symbol Reference > Classes > TJwSecureFileObject Class > TJwSecureFileObject Methods > TJwSecureFileObject.SupportACL Method
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
TJwSecureFileObject.SupportACL Method
Pascal
class function SupportACL(RootPathName: TJwString): boolean;
Parameters 
Description 
RootPathName: TJwString 
contains a drive path or UNC path. A drive must consist at least of a char followed by ":". The function parses the drive letter automatically from a full path name. e.g.  

Returns true if ACL is supported; otherwise false. 

= ''; 

i := Length(PathName); while (i > 0) do begin if (i < Length(PathName)) and ((PathName[i] = '') or (PathName[i] = '/') or (PathName[i] = ':')) then break; 

= PathName[i] + result; 

Dec(i); end; for i2 := 1 to i do S := S + PathName[i2]; 

if bStop then 

= GetParent(s) else 

= s; end; 

var i : Integer; aDACL : TJwDAccessControlList; c : Integer; s : TJwString; begin SD := GetNamedSecurityInfo(PathName, SE_FILE_OBJECT, [siDaclSecurityInformation]); 

try aDACL := SD.DACL

if Length(pInhArray) = 0 then SetLength(pInhArray, aDACL.Count); 

c := Pos; if Pos = -1 then begin Pos := 0; c := aDACL.Count -1; end; 

for i := Pos to c do begin //TODO !!!! hier nochmal überdenken mit pos, da parent nicht unbedingt gleiche ACLs hgaben müssen // suchen nach sID ? if (afInheritedAce in aDACL[i].Flags) //or (afContainerInheritAce in aDACL[i].Flags) then begin S := aDACL[i].GetText; if s = '' then; Inc(Level); PathName := GetParent(PathName); UpdateObjectInheritedDACL(PathName, pInhArray, i, Level); end else begin S := aDACL[i].GetText; if s = '' then; 

pInhArray[i].GenerationGap := Level-1; pInhArray[i].AncestorName := PathName; end; 

end; 

finally SD.Free; SD := nil; end; end;

SupportACL checks if a given drive or UNC Path supports ACL.

Exceptions 
Description 
will be raised if GetVolumeInformation returned an error 
will be raised if RootPathName contains no drive letter or does not contain a valid UNC path.
procedure UpdateObjectInheritedDACL(PathName : TJwString; var pInhArray : TJwInheritedFromArray; Pos, Level : Integer); function GetParent(PathName : TJwString; bStop : Boolean = false) : TJwString; var l,l2,i,i2 : Integer; s : TJwString; begin 
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!