diff --git a/authzgroups.php b/authzgroups.php index d5460ba..3a2c574 100644 --- a/authzgroups.php +++ b/authzgroups.php @@ -120,7 +120,7 @@ class authzgroups return $ressource[$object]; } - /** Return TRUE if the user right allow to see the object + /** Return TRUE if the user right allow to see the object (RO or RW) Return a 403 Exception if the user don't have the right Return a 401 Exception if the user is not connected */ public function accessRight ($module, $user, $object) @@ -137,6 +137,7 @@ class authzgroups if ($object === null || ! is_string ($object)) throw new Exception ("Object not provided to authzgroups\\accessRight", 500); + if ($object === "/") $object = ""; $rc = $this->allow ($module, $user, "/$object"); trigger_error ("authzgroups : accessRight ('$module','$user','/$object')". "=$rc", E_USER_NOTICE); @@ -147,7 +148,7 @@ class authzgroups throw new Exception (_("Access forbidden"), 403); } - /** Return TRUE if the user right allow to edit the object + /** Return TRUE if the user right allow to edit the object (RW only) Return a 403 Exception if the user don't have the right Return a 401 Exception if the user is not connected */ public function accessWrite ($module, $user, $object) @@ -164,6 +165,7 @@ class authzgroups if ($object === null || ! is_string ($object)) throw new Exception ("Object not provided to authzgroups\\accessWrite", 500); + if ($object === "/") $object = ""; $rc = $this->allow ($module, $user, "/$object"); trigger_error ("authzgroups : accessWrite ('$module','$user','/$object')". "=$rc", E_USER_NOTICE); @@ -175,7 +177,7 @@ class authzgroups } /** Return TRUE if the user right allow to see but without modification - the object + the object (RO only) Return a 403 Exception if the user don't have the right Return a 401 Exception if the user is not connected */ public function accessReadOnly ($module, $user, $object) @@ -192,6 +194,7 @@ class authzgroups if ($object === null || ! is_string ($object)) throw new Exception ("Object not provided to authzgroups\\accessReadOnly", 500); + if ($object === "/") $object = ""; $rc = $this->allow ($module, $user, "/$object"); trigger_error ("authzgroups : accessReadOnly ('$module','$user','/$object')" ."=$rc", E_USER_NOTICE);