Tuesday 25 May 2010 7:44:59 am
It is obviously possible to define security rules, configurable in the same way, for our own modules. All we need to do is to create a list of functions for our module, in module.php.
extension/myextension/modules/mymodule/module.php :
<?php $Module = array('name' => 'mymodule'); $ViewList = array(); $ViewList['myview'] = array( 'script' => 'view.php', 'params' => array(), 'functions' => array( 'myfunction' ) ); $FunctionList['myfunction'] = array();
Here we define a function for the module mymodule and we affect it to the view myview. This function will display in the corresponding list when creating a new security policy for module mymodule in the admin interface. You will find this kind of definition in most of modules contained in the kernel, or within extensions developped by eZ Systems or by the community (this is the case for NovenINIUpdate extension).
What I described above is sufficient in most cases, but what if we need to add more complex limitations like in content module (language, section, etc...) ?