Example #1
0
 function it_should_parse_a_SDDL_string_that_represents_the_default_exchange_mailbox_permissions()
 {
     $exchHex = '010004801400000020000000000000002c00000001010000000000050a00000001010000000000050a00000004001c0001000000000214000100020001010000000000050a000000';
     $exchSddl = 'O:PSG:PSD:(A;CI;RCCC;;;PS)';
     $this->parse($exchSddl)->toBinary()->shouldBeEqualTo(hex2bin($exchHex));
     $sd = (new SecurityDescriptor())->setOwner(new SID('PS'))->setGroup(new SID('PS'));
     $acl = new Dacl();
     $ace = (new Ace(new AceType('A')))->setFlags((new AceFlags())->add(AceFlags::SHORT_NAME['CI']))->setRights((new AceRights())->add(AceRights::SHORT_NAME['RC'])->add(AceRights::SHORT_NAME['CC']))->setTrustee(new SID('PS'));
     $acl->addAce($ace);
     $sd->setDacl($acl);
     $this->parse($exchSddl)->toBinary()->shouldBeEqualTo($sd->toBinary());
 }