I've had this annoying problem before, which drove me insane trying to get it to work
open phpmyadmin , go your simpleInvoces DB->user_role table you'll find one role there whch is the administrator, add roles to it like (biller , customer, warehouse ..) each with a different unique id
now you can add users, and to set different permission for the users , go to the acl.php (includes directory) and assign roles to them here is my biller role:
The si_user_role table now has the new row id=4 and name=clerk The si_user table now has a new user email=bobby role_id=4 domain_id=1 enabled=1 and the password is set.
So accordingly I added this to the bottom of the acl.php file: $acl->allow('clerk'); $acl->deny('clerk','options'); $acl->deny('clerk','system_defaults'); $acl->deny('clerk','custom_fields'); $acl->deny('clerk','user'); $acl->deny('clerk','tax_rates'); $acl->deny('clerk','preferences'); $acl->deny('clerk','payment_types');
Rebooted all the systems.
Now when I try to login via the usual URL http://192.168.2.18/simpleinvoices/ It does NOT even show the login screen, instead it shows: ------------- Fatal error: Uncaught exception 'Zend_Acl_Role_Registry_Exception' with message 'Role 'clerk' not found' in /var/www/simpleinvoices/library/Zend/Acl/Role/Registry.php:132 Stack trace: #0 /var/www/simpleinvoices/library/Zend/Acl.php(742): Zend_Acl_Role_Registry->get('clerk') #1 /var/www/simpleinvoices/include/check_permission.php(7): Zend_Acl->isAllowed('clerk', NULL, NULL) #2 /var/www/simpleinvoices/include/init.php(177): include_once('/var/www/simple...') #3 /var/www/simpleinvoices/index.php(26): require_once('/var/www/simple...') #4 {main} thrown in /var/www/simpleinvoices/library/Zend/Acl/Role/Registry.php on line 132 -------------
Thanks. That did it. Now I can limit access for clerks AND give full access to the business owner.
For the clerks, I also need to deny access to the following: * Add New Product * Edit Product * Add Customer * Edit Customer * Add New Biller * Edit Biller
(The business owner will take responsibility of these features.)
Which modules do I specify in $acl->deny('clerk','???????'); to enforce it?