X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Customize admin area according user permission. (https://forum.x-cart.com/showthread.php?t=75190)

ajeetsingh 04-11-2017 04:16 AM

Customize admin area according user permission.
 
Hello x-cart Team,

I have an issue that how to assign a particular admin left-menu item access to a particular user except main administrator. Is It possible in x-cart? please suggest.

Now i am explaining in better way below. So Please suggest me.

1. I have a main admin login account already who has a full access of the admin area.
2. Again i am creating another user account a administrator and want that user to particular left menu like : when i login with that user account in x-cart back-end then he has only access to see the Module option in x-cart admin area.
3. So my question is that, Is it possible in x-cart and if possible then please let me explain that how it is possible.

I am waiting for a response. So please suggest me the way that how i fix my issue.

Thank you in advance.
Have a nice day.

qualiteam 04-11-2017 05:12 AM

Re: Customize admin area according user permission.
 
1 Attachment(s)
There is a module that allows you to create user roles and grant permissions:
https://market.x-cart.com/addons/user-permissions.html

The Modules page is visible only to those users who has a role with the "Root access" permission.

So, you can create other role (e.g. "Shop administrator") and give it every permission except "Root access". This will hide Modules page (and some other system pages) from users having this role.

Is it what you are looking for?

ajeetsingh 04-11-2017 05:42 AM

Re: Customize admin area according user permission.
 
Hello Qualiteam,

I have followed your suggestion and its work. But my query is that i also want to show Module option in left menu and hide other options like "store setup", "Look and fell" and "System Setting".

qualiteam 04-11-2017 08:13 AM

Re: Customize admin area according user permission.
 
This is the class that controls the Modules page:
https://github.com/xcart/xcart5/blob/master/src/classes/XLite/Controller/Admin/Module.php

You should decorate it from your custom module, add the checkACL() method and change it so that the page is visible to users that you need. You can find this method in the parent class:
https://github.com/xcart/xcart5/blob/master/src/classes/XLite/Controller/Admin/AAdmin.php

Also, you may need to decorate the following classes from your custom module:
- https://github.com/xcart/xcart5/blob/3baf515b75d0155444353fca15545c9a655411bc/src/classes/XLite/View/Menu/Admin/LeftMenu.php
- https://github.com/xcart/xcart5/blob/c8b4fa7834a61239735f84527b4095723304e6fc/src/classes/XLite/View/Menu/...place/Menu.php


All times are GMT -8. The time now is 03:26 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.