ez.no / exponential / documentation / development / extensions / module / permissions
If you would like to have special permissions to your module you need to define this in module.php.
If you don't define any functions, permission will only be controlled on a module level. Access to module or not.
If we extend the hello world example to include a list page and an edit page the module definition, module.php, file would contain something like this:
<?php $Module = array( "name" => "MyModule" ); $ViewList = array(); $ViewList["hello"] = array( 'script' => 'hello.php', "functions" => array( 'read' ), 'params' => array() ); $ViewList["list"] = array( 'script' => 'list.php', "functions" => array( 'read' ), 'params' => array() ); $ViewList["edit"] = array( 'script' => 'edit.php', "functions" => array( 'edit' ), 'params' => array( 'ItemID' ), 'single_post_actions' => array( 'StoreButton' => 'Store', 'CancelButton' => 'Cancel' ), ); $FunctionList['read'] = array( ); $FunctionList['edit'] = array( ); ?>
Here we define two functions, read and edit. We also define two new views; list and edit. We give hello and list read permission. Edit is assigned edit permission. This is the only thing we need to do to get permissions on function level in our module.
Log in or create a user account to comment.
Comments