summaryrefslogtreecommitdiffstats
path: root/lib/api/kolab_api_service_role.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-10-22 11:38:00 +0200
committerAleksander Machniak <alec@alec.pl>2012-10-22 11:38:00 +0200
commit8e51264407f4e89b2cee325e98f12ee6eb0436f8 (patch)
tree616c53520cc2cad22920d5734a8863f97f368913 /lib/api/kolab_api_service_role.php
parentb6e5f325671cde2712dc449b744c72ab46a98282 (diff)
downloadwebadmin-8e51264407f4e89b2cee325e98f12ee6eb0436f8.tar.gz
Fix warning on role.effective_rights
Diffstat (limited to 'lib/api/kolab_api_service_role.php')
-rw-r--r--lib/api/kolab_api_service_role.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/kolab_api_service_role.php b/lib/api/kolab_api_service_role.php
index 0deecf9..18ebf19 100644
--- a/lib/api/kolab_api_service_role.php
+++ b/lib/api/kolab_api_service_role.php
@@ -146,7 +146,11 @@ class kolab_api_service_role extends kolab_api_service
$unique_attr = 'nsuniqueid';
}
- $role_dn = $auth->role_find_by_attribute(Array($unique_attr => $getdata['role']));
+ $role = $auth->role_find_by_attribute(Array($unique_attr => $getdata['role']));
+
+ if (is_array($role) && count($role) == 1) {
+ $role_dn = key($role);
+ }
}
$effective_rights = $auth->list_rights(empty($role_dn) ? 'role' : $role_dn);