Limit warehouse stock view to certain users

Hi!

I need to assign certain users to manage stock on specific warehouses, but avoiding the viewing and modifying of others. Is it any advanced permissions module or even a way to do this?
Thank you very much

1 Like

I suppose, that either this question is not possible to respond at the time, or its solution is obvious. Is it either?
Thank you!

Hello,

Not possible with core modules and I don’t know an external module that allows it.

Thank you very much, ksar.

As far as I have checked, there’s no module with this function.

I tried using hooks however it ended to be hard so I changed standard code so I got it done by adding a extrafield “warehouseowner” of multiple selectlist, then in stock descriptor (usually found in /htdocs/core/modules/modStock.class.php) assign the advance permission such as
$r++;
$this->rights[$r][0] = $this->numero . sprintf(‘%02d’, (0 * 10) + 0 + 1); //autogenerate permission id based on the module ID;
$this->rights[$r][1] = ‘ViewModifyOwnWarehouse (assigned in WarehouseOwner list field)’;
$this->rights[$r][2] = ‘w’;
$this->rights[$r][3] = 0;
$this->rights[$r][4] = ‘stock_advance’;
$this->rights[$r][5] = ‘write’;
Disable, renable Stock module, finally
in stock page.php assign the permission such as $permissiontoviewownwarehouse = $user->hasRight(‘stock’, ‘warehouses_advance’, ‘write’);
and place it where you need to check on that specific permission. HTH