summaryrefslogtreecommitdiffstats
path: root/ahl-binding
diff options
context:
space:
mode:
Diffstat (limited to 'ahl-binding')
-rw-r--r--ahl-binding/ahl-binding.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/ahl-binding/ahl-binding.cpp b/ahl-binding/ahl-binding.cpp
index 79cf7b2..ce31499 100644
--- a/ahl-binding/ahl-binding.cpp
+++ b/ahl-binding/ahl-binding.cpp
@@ -386,9 +386,21 @@ int ahl_binding_t::create_api_verb(role_t* r)
void ahl_binding_t::get_roles(afb_request* req)
{
+ json_bool verbose = FALSE;
+ json_object* arg = afb_request_json(req);
+ json_object* jverbose;
+ if (arg != nullptr)
+ {
+ json_bool ret = json_object_object_get_ex(arg, "verbose", &jverbose);
+ if (ret) verbose = json_object_get_boolean(jverbose);
+ }
+
json_object* result = json_object_new_array();
for(const auto& r : roles_)
- json_object_array_add(result, json_object_new_string(r.uid().c_str()));
+ {
+ if (verbose == TRUE || r.device_uri().size())
+ json_object_array_add(result, json_object_new_string(r.uid().c_str()));
+ }
afb_request_success(req, result, nullptr);
}