public function toSddl($canonicalize = true)
{
// These will always be present in the SDDL...
$sddl = 'O:' . ($this->owner->getShortName() ?: $this->owner) . 'G:' . ($this->group->getShortName() ?: $this->group);
foreach ([$this->dacl, $this->sacl] as $acl) {
// It should be omitted if empty or not set...
if ($acl && count($acl->getAces()) > 0) {
$sddl .= $acl->getSddlIdentifier() . ':' . $this->getAclSddlFlags($acl);
$sddl .= $acl instanceof Dacl ? $acl->toSddl($canonicalize) : $acl->toSddl();
}
}
return $sddl;
}