As a Dolibarr module developer you may find issue with the dynamic permission allocation issues. The current Dolibarr Module Development documentation is not full. As a new module developer you may face so many problems. But it is not possible to get all the answers in the Internet related to module development. This document may solve the following problems in the module development process.
The most common mistake that developers usually do is choosing incorrect name for the module's RIGHTS class. Lets say if your module name is ALDictionary, make sure you have not gave the same name for RIGHTS class. Like incorrect rights class name is ALDictionary; while correct name is aldictionary. Please see the image for details.
Â
Make sure the configuration class is initialized and has different name than the main module core class. Here the correct sample code is given below:
Â
if (! isset($conf->aldictionary) || ! isset($conf->aldictionary->enabled)) {
$conf->aldictionary = new stdClass();
$conf->aldictionary->enabled = 0;
}
Â
Â
Â
You should not use the same name as of main class.
Check your menu array definition. There are two important keys to check. One is enabled and another is perms. To make your module permission is handled by Dolibarr itself, you should give the code string as follows '$conf->aldictionary->enabled' and $user->rights->aldictionary->read. Make sure you have put these under single quote.
Â
Dolibarr module uninstallation process is not too much intelligent. While you are enabling and disabling your module again and again for testing, Dolibarr keeps the garbage data in few rights MySQL tables. The tables name are llx_rights_def
and llx_user_rights
respectively. These two tables holds the data for module's rights. Navigate through the table each and delete the rows that corresponding to your module (check $this->numero of your module descriptor file). Now enable your module again. Now the permission should work.
Â
Note: If the all above three steps does not solve your problem you can contact us without any hesitation. We will be happy to assist you.
There are zero sub-categories in this parent category.
There are zero sub-categories in this parent category.
There are zero sub-categories in this parent category.