I want to hide admin menu items, to which current user hasn't access permission. Any ideas, how to implement this?
Solution is found on this page http://forum.opencart.com/viewtopic.php?p=97682#p97682 in this topic.
Reason: Topics merged + title changed
Programmer have to create special module.
In a few words you have to check role of user (you have administrator and customers in db) and show
corresponding menu items, so you have to rebuild menu architecture, add field with information to wich of roles it must be shown.
What do you mean saying module? I'm new to opencart and still learning the source, but so far I didn't saw ability, to attach custom module or plugin to desired controller. Am I wrong?xyligan wrote: Programmer have to create special module.
I'm working with user groups and I need to hide the options that the user can't access (e.g. Catalog -> Products). I've searched the DB but my solution is pretty complex, I need one simpler.

Anyone have any idea?
Thks
--
Rochester Oliveira
http://www.bluebell.no/order/whmcs/aff.php?aff=001
Kun 999,- i året inklusiv domene.
http://www.bluebell.no/order/whmcs/aff.php?aff=001
Kun 999,- i året inklusiv domene.
System>Users>User Groups - there you can create a group with the necessary options for editing. You can use the Demonstration user to test out your permissions for Access and Modify there.
Hope this has helped
A stupid question is the one you -don't- ask.........(Anon)
)C1.5.0.1 (IN devel)
OC V1.4.9.5
OC V1.4.9.2
OC V1.4.7
OC V1.3.4
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Does anyone know of a way to hide admin menu items that a user does not have permission to access?
I know I can edit the header file, but this would then need editing again if permissions are changed
And I don't want to confuse my users with menu items shown that they cannot access
Thanks
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
I only had to add checks on each <li> using the function hasPermission(). If the admin user has access permission then the list item is shown (the if block is executed). On parent menu items I checked to see if the admin user had access to any of the children items (Products is the child of Catalog for example). If it did then the parent list item is shown. If not then the parent list item is skipped.
I attached the modified header.tpl file with the above modifications (it is from version 1.4.9).
The attached file replaces:
admin/view/template/common/header.tpl
Attachments
This is a vQmod file for hiding menu items for OpenCart version 1.5.1.1
Header Template modified to use hasPermission to access.
Try this solution here: http://forum.opencart.com/viewtopic.php?p=97682#p97682jknutsen wrote:How did u do it?
Here is the solution for hiding the menu items to which the user shouldn't have access, including a header.tpl file that has already been modified:sliux wrote:Hello,
I want to hide admin menu items, to which current user hasn't access permission. Any ideas, how to implement this?
http://forum.opencart.com/viewtopic.php ... t=0#p97682
If you are talking about hiding the admin menu items that a user doesn't have access permission for then your answer is to modify the header.tpl. Here is how to do it, with an attached modified header.tpl:Xsecrets wrote:yes, but that won't hide the options, it will just give a permissions error when a user that doesn't have permissions tries to access it. There are currently no mods that actually hide it. A mod that hides stuff from there probably wouldn't be too hard to write, but he also mentioned not having access to certain settings, and that would require some major rewrites to make it that granular.
http://forum.opencart.com/viewtopic.php?p=97682#p97682
Users browsing this forum: No registered users and 22 guests