summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-12 10:26:48 +0200
committerAleksander Machniak <alec@alec.pl>2013-04-12 10:26:48 +0200
commitd1b909c124910576a6b22cca11ebd08344e10e3c (patch)
tree50ca000a9bd89028595f0f1f0d9b6c52116a1a68
parentacddf93a9ff407eae3c5216d134e5f0a42ff05f9 (diff)
downloadwebadmin-d1b909c124910576a6b22cca11ebd08344e10e3c.tar.gz
Remove not implemented find* capabilities, some code cleanup
-rw-r--r--lib/api/kolab_api_service_domain.php7
-rw-r--r--lib/api/kolab_api_service_group.php8
-rw-r--r--lib/api/kolab_api_service_resource.php12
-rw-r--r--lib/api/kolab_api_service_role.php8
-rw-r--r--lib/api/kolab_api_service_type.php7
-rw-r--r--lib/api/kolab_api_service_user.php4
6 files changed, 13 insertions, 33 deletions
diff --git a/lib/api/kolab_api_service_domain.php b/lib/api/kolab_api_service_domain.php
index 2d91358..0234832 100644
--- a/lib/api/kolab_api_service_domain.php
+++ b/lib/api/kolab_api_service_domain.php
@@ -48,8 +48,7 @@ class kolab_api_service_domain extends kolab_api_service
}
$effective_rights = $auth->list_rights($domain_base_dn);
-
- $rights = array();
+ $rights = array();
if (in_array('add', $effective_rights['entryLevelRights'])) {
$rights['add'] = "w";
@@ -64,10 +63,6 @@ class kolab_api_service_domain extends kolab_api_service
}
if (in_array('read', $effective_rights['entryLevelRights'])) {
- $rights['find'] = "r";
- $rights['find_by_any_attribute'] = "r";
- $rights['find_by_attribute'] = "r";
- $rights['find_by_attributes'] = "r";
$rights['info'] = "r";
}
diff --git a/lib/api/kolab_api_service_group.php b/lib/api/kolab_api_service_group.php
index 9357e74..35c9739 100644
--- a/lib/api/kolab_api_service_group.php
+++ b/lib/api/kolab_api_service_group.php
@@ -39,13 +39,9 @@ class kolab_api_service_group extends kolab_api_service
{
//console("kolab_api_service_group::capabilities");
- $auth = Auth::get_instance();
-
+ $auth = Auth::get_instance();
$effective_rights = $auth->list_rights('group');
-
- //console("effective_rights", $effective_rights);
-
- $rights = array();
+ $rights = array();
if (in_array('add', $effective_rights['entryLevelRights'])) {
$rights['add'] = "w";
diff --git a/lib/api/kolab_api_service_resource.php b/lib/api/kolab_api_service_resource.php
index 48b3a88..8474de2 100644
--- a/lib/api/kolab_api_service_resource.php
+++ b/lib/api/kolab_api_service_resource.php
@@ -39,13 +39,9 @@ class kolab_api_service_resource extends kolab_api_service
{
//console("kolab_api_service_group::capabilities");
- $auth = Auth::get_instance();
-
+ $auth = Auth::get_instance();
$effective_rights = $auth->list_rights('resource');
-
- //console("effective_rights", $effective_rights);
-
- $rights = array();
+ $rights = array();
if (in_array('add', $effective_rights['entryLevelRights'])) {
$rights['add'] = "w";
@@ -60,10 +56,6 @@ class kolab_api_service_resource extends kolab_api_service
}
if (in_array('read', $effective_rights['entryLevelRights'])) {
- $rights['find'] = "r";
- $rights['find_by_any_attribute'] = "r";
- $rights['find_by_attribute'] = "r";
- $rights['find_by_attributes'] = "r";
$rights['info'] = "r";
}
diff --git a/lib/api/kolab_api_service_role.php b/lib/api/kolab_api_service_role.php
index cf1e339..fc15d0b 100644
--- a/lib/api/kolab_api_service_role.php
+++ b/lib/api/kolab_api_service_role.php
@@ -39,13 +39,9 @@ class kolab_api_service_role extends kolab_api_service
{
//console("kolab_api_service_role::capabilities");
- $auth = Auth::get_instance();
-
+ $auth = Auth::get_instance();
$effective_rights = $auth->list_rights('role');
-
- //console("effective_rights", $effective_rights);
-
- $rights = array();
+ $rights = array();
if (in_array('add', $effective_rights['entryLevelRights'])) {
$rights['add'] = "w";
diff --git a/lib/api/kolab_api_service_type.php b/lib/api/kolab_api_service_type.php
index 0c47c89..9faeff1 100644
--- a/lib/api/kolab_api_service_type.php
+++ b/lib/api/kolab_api_service_type.php
@@ -43,14 +43,19 @@ class kolab_api_service_type extends kolab_api_service
if (in_array('add', (array)$effective_rights['entryLevelRights'])) {
$rights['add'] = "w";
}
+
if (in_array('delete', (array)$effective_rights['entryLevelRights'])) {
$rights['delete'] = "w";
}
+
if (in_array('modrdn', (array)$effective_rights['entryLevelRights'])) {
$rights['edit'] = "w";
}
- $rights['info'] = "r";
+ if (in_array('read', (array)$effective_rights['entryLevelRights'])) {
+ $rights['info'] = "r";
+ }
+
$rights['effective_rights'] = "r";
return $rights;
diff --git a/lib/api/kolab_api_service_user.php b/lib/api/kolab_api_service_user.php
index 578e102..a8b286d 100644
--- a/lib/api/kolab_api_service_user.php
+++ b/lib/api/kolab_api_service_user.php
@@ -60,10 +60,6 @@ class kolab_api_service_user extends kolab_api_service
}
if (in_array('read', $effective_rights['entryLevelRights'])) {
- $rights['find'] = "r";
- $rights['find_by_any_attribute'] = "r";
- $rights['find_by_attribute'] = "r";
- $rights['find_by_attributes'] = "r";
$rights['info'] = "r";
}