Enable creation of new entries via templates

This commit is contained in:
2025-06-11 19:28:38 +09:30
parent 820f398c2c
commit 9f0290bd40
7 changed files with 100 additions and 22 deletions

View File

@@ -147,7 +147,7 @@ class Entry extends Model
// Filter out our templates specific for this entry
if ($this->dn && (! in_array(strtolower($this->dn),['cn=subschema']))) {
$this->templates = $this->templates
->filter(fn($item)=>! count(array_diff($item->objectclasses,array_map('strtolower',Arr::get($this->attributes,'objectclass')))));
->filter(fn($item)=>! count($item->objectclasses->diff(array_map('strtolower',Arr::get($this->attributes,'objectclass')))));
}
return $this;