rejetto forum

inherited flags

Mars · 5 · 1315

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2036
    • View Profile
Quote
procedure TmainFrm.appEventsShowHint
  ...
  s:=flag('Invisible', FA_HIDDENTREE, TRUE);
  if s = '' then s:=flag('Invisible', FA_HIDDEN);
  result:=result+s
    +flag('Download forbidden', FA_DL_FORBIDDEN)
    +flagR('Don''t log', FA_DONT_LOG);

'Invisible' and 'Download forbidden' are inherited flags

Quote
procedure TmainFrm.appEventsShowHint
  ...
  s:=flagR('Invisible', FA_HIDDENTREE, TRUE);
  if s = '' then s:=flag('Invisible', FA_HIDDEN);
  result:=result+s
    +flagR('Download forbidden', FA_DL_FORBIDDEN)
    +flagR('Don''t log', FA_DONT_LOG);

« Last Edit: February 03, 2010, 12:03:37 AM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
ok for hiddentree.
dl_forbidden is a bitter one. it is NOT recursive by design, but i see some strange recursion in the code. i fear there's an inconsistent behavior. it will take a while to study it, i cannot do it right now.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
ok. i did my best with the short time i had.
i made some changes to the way "no download" is handled, to reflect its designed nature.
my purpose was not to improve it, but to make it coherent with how it was thinked and documented (was "let download").
if you have time, please check the changes in the source (build 255) and report if there's a possibility to break the security.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2036
    • View Profile
Quote
dl_forbidden is a bitter one. it is NOT recursive by design

Quote
function Tfile.accessFor(username, password:string):boolean;
var
  a: Paccount;
  f: Tfile;
  list: TStringDynArray;
begin
result:=FALSE;
if isFile() and hasRecursive(FA_DL_FORBIDDEN) then exit;
result:=FALSE;
f:=self;



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13308
    • View Profile
that's what i meant when i said

but i see some strange recursion in the code.

what i found is that most of times that recursion was a simple way to make it work, since there's a form of single-step inheriting for real folders.
it's the GUI that prevents you from applying it to virtual folders.
i decided to change it, because it's confusing.
if you want to check my changes i can send you a preview.