mirror of
https://github.com/Icinga/icinga2.git
synced 2026-06-10 09:10:54 -04:00
Ensure that user input for groups is unique on API object creation
refs #4732
This commit is contained in:
parent
88d99094bf
commit
f070d2136a
1 changed files with 8 additions and 0 deletions
|
|
@ -71,6 +71,14 @@ bool CreateObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& r
|
|||
}
|
||||
}
|
||||
|
||||
/* Sanity checks for unique groups array. */
|
||||
if (attrs->Contains("groups")) {
|
||||
Array::Ptr groups = attrs->Get("groups");
|
||||
|
||||
if (groups)
|
||||
attrs->Set("groups", groups->Unique());
|
||||
}
|
||||
|
||||
Dictionary::Ptr result1 = new Dictionary();
|
||||
String status;
|
||||
Array::Ptr errors = new Array();
|
||||
|
|
|
|||
Loading…
Reference in a new issue