Jump to content

Restrict user to only some product tabs in BO


Recommended Posts

Hello,

 

I want to hire a writer who will be responsible for quality descriptions of products in my store.

This person should see only product catalog and be able to modify:

- product description (short & long),

- seo fields.

 

Other tabs should be hidden. I don't want this person to know what are wholesale prices for example. More importantly, I don't want him to spoil anything by accidentally modifying other settings on product.

 

I see that it is impossible to restrict profile priviledges (ritghts) to selected product tabs.

 

Are you aware if there is any module which allows you set specific user/profile priviledges to product tabs?

 

Many thanks all hints!

Edited by gloomybear (see edit history)
Link to comment
Share on other sites

I have found a solution myself. Posting as it may help others in future.

 

Simplest solution is to overwrite AdminProductController with below code.

class AdminProductsController extends AdminProductsControllerCore {
	public function __construct() {
		parent::__construct();

		// restriction of tabs per user profile
		$this -> restrictTabs();
	}

	// restriction of available tabs for some profiles
	private function restrictTabs() {
		//profile_id = 7 - Set profile ID which you want to restrict
		if ($this -> context -> employee -> id_profile == 7) {
			foreach ($this->available_tabs as $tab_key => $tab_value) {
				if (!($tab_key == 'Informations' or $tab_key == 'Seo')) { // tabs to leave
					unset($this -> available_tabs[$tab_key]);
				}
			}
		}
	}

}
  • Like 3
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...