Modified:2017-12-26  Published:2017-12-26  Views: 9664
Author: hasanuzzaman
Published in: Dolibarr
Module Development: Error In Dolibarr Menu Permission - Solved

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.

  1. If problem with module enabling
  2. If the menu permission does not work correctly.
  3. If Module Rights class not working.
  4. Problem with dynamic permission.

dolibarr menu permission help

Solution to Dolibarr menu permission error

First Step:

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.dolibarr menu permission

 

Second Step:

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.

Third Step:

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.

 

Fourth Step:

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.

Article Comments

0 comments.

There are zero comments yet, why not be the first?

You must be logged in to post a comment.

Please log in or register to comment or reply to a comment.

Articles Search

Featured Articles

Most Popular Articles

Article Categories Expand

10  
1  
1  
1  
0  
6  
0  
85  
7  

There are zero sub-categories in this parent category.

127  
4  
63  
6  
3  
3  
10  
5  
9  
4  
12  
6  
3  
0  
1  
73  
16  
1  
1  
25  
2  
2  
0  
2  
1  
2  
2  
7  
0  
1  
0  
2  
2  
2  
13  
2  
1  
3  
2  
1  
0  
2  
3  
3  
0  
1  
5  
0  
3  
4  
1  
17  
62  
2  
1  
0  
1  
0  
0  
6  
1  
1  
41  
1  
1  
2  
0  
12  
0  
0  
0  
0  
7  
3  
0  
2  
2  
2  

There are zero sub-categories in this parent category.

4  
1  
5  
6  
0  
3  
2  
1  
0  
1  
1  
2  
0  
4  
2  
0  
5  
1  
26  
1  

There are zero sub-categories in this parent category.

0  
1  
0  
1  
0  
1  
0  
1  
0  
0  
0  
2  
31  
1  
20  
3  
2  
0  
0  
0  
0  
1  
1  
0  
1  
0  
0  
0  
1  
0  
37  
0  
1  
5  
0  
2  
2  
0  
0  
0  
0  
2  
10  
2  

Sponsor