mirror of https://github.com/Icinga/icinga2.git
Ensure that user input for groups is unique on API object creation
refs #4732
This commit is contained in:
parent
88d99094bf
commit
f070d2136a
|
@ -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 New Issue