Documentation
checkService
usage
$security->checkService( string moduleName , string serviceName [ , string requiredPermission ] )
paramètres
moduleName: the name of the module for which the service should be authorized
serviceName: the name of the service that should be authorized to pass the security check. Can take the following values : dependencies, category, comment, description.
requiredPermission: indicates what permission is necessary on the service. The values can be R (read-only) or W (writable). There is also a special value D for the comment service, which means the user is a comment administrator and can write comments in place of other users.
retourne
throws a SusheeSecurityException if the user is not authorized.
Checks whether the connected user has access to the service for the given module.
The service is enabled in the SERVICES field of the modulekey for this module in the keyring of the user.
exemples
include_once("../Kernel/common/security.class.php");
try{
$security = new SusheeSecurity();
$security->checkService('contact','comment');
}catch( SusheeSecurityException $E ){
exit( 'Warning : '.$E->getMessage() );
}