authzgroups : remove a / if it is alone. Permit to check if the rights on / object is available

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2257 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-08-17 14:32:10 +00:00
parent bf4d1e036e
commit 2a145e4db4

View File

@@ -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);