summaryrefslogtreecommitdiffstats
path: root/lib/kolab_api_controller.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-01-20 15:51:00 +0100
committerAleksander Machniak <machniak@kolabsys.com>2012-01-20 15:51:00 +0100
commit9822f33b6340da429d86efe0513491c22c9a284d (patch)
treea5ce6d5223f58c4d3211cfe53117fffa34e879f3 /lib/kolab_api_controller.php
parent88b57e40999441c0bf9c994ca5bf878e532800de (diff)
downloadwebadmin-9822f33b6340da429d86efe0513491c22c9a284d.tar.gz
Unify user_types and capabilities responses (list and count items)
Return capabilities as hashes not arrays
Diffstat (limited to 'lib/kolab_api_controller.php')
-rw-r--r--lib/kolab_api_controller.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index bf1d96f..3fcc74c 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -219,20 +219,23 @@ class kolab_api_controller
$domain_name = is_array($domain) ? $domain['associateddomain'] : $domain;
// define our very own capabilities
$actions = array(
- array('action' => 'system.quit', 'type' => 'w'),
+ 'system.quit' => array('type' => 'w'),
);
foreach ($this->services as $sname => $handler) {
$service = $this->get_service($sname);
foreach ($service->capabilities($domain) as $method => $type) {
- $actions[] = array('action' => "$sname.$method", 'type' => $type);
+ $actions["$sname.$method"] = array('type' => $type);
}
}
- $result[] = array('domain' => $domain_name, 'actions' => $actions);
+ $result[$domain_name] = array('actions' => $actions);
}
- return array('capabilities' => $result);
+ return array(
+ 'list' => $result,
+ 'count' => count($result),
+ );
}
private function get_domain() {