Documentation
setSecurity
usage
Sushee_Shell->setSecurity( boolean secure )
paramètres
secure: if the security should be applied or not
Applies the security on the commands executed. If the security is not applied, everything is public, but if security is applied:
- private elements are only returned if the connected user is the owner (or if the user has an admin keyring that gives access to all elements)
- elements are only returned if you have access to the type of elements (MODULEKEY)
See the Security manual for more details.
exemples
include_once('../sushee/common.php');
$shell = new Sushee_Shell();
$shell->addCommand(
'<SEARCH>
<CONTACT/>
</SEARCH>');
$shell->execute();
echo $shell->count('/RESPONSE/RESULTS/CONTACT'); // a number of elements
$shell->setSecurity(true);
$shell->addCommand(
'<SEARCH>
<CONTACT/>
</SEARCH>');
$shell->execute();
echo $shell->count('/RESPONSE/RESULTS/CONTACT'); // number will be different if the user has a privative modulekey on CONTACT. A privative modulekey will only give access to the public elements or the elements which you own