Commit 74ea3f88 authored by Jonathan Swaelens's avatar Jonathan Swaelens
Browse files

:sparkles: feat(webservice): Add requiredAttributes to webservice

Add requiredAttributes to webservice
Showing with 5 additions and 0 deletions
+5 -0
...@@ -577,12 +577,17 @@ class fdRestService extends fdRPCService ...@@ -577,12 +577,17 @@ class fdRestService extends fdRPCService
} }
foreach ($fields as &$section) { foreach ($fields as &$section) {
$attributes = []; $attributes = [];
$requiredAttributes = [];
foreach ($section['attrs'] as $attr) { foreach ($section['attrs'] as $attr) {
if ($object->attrIsReadable($attr)) { if ($object->attrIsReadable($attr)) {
$attributes[] = $attr->getLdapName(); $attributes[] = $attr->getLdapName();
if($attr->isRequired()) {
$requiredAttributes[] = $attr->getLdapName();
}
} }
} }
$section['attrs'] = $attributes; $section['attrs'] = $attributes;
$section['requiredAttrs'] = $requiredAttributes;
} }
unset($section); unset($section);
return ['sections' => $fields, 'sections_order' => array_keys($fields)]; return ['sections' => $fields, 'sections_order' => array_keys($fields)];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment