Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Readonly prices and inventories overviews in SKU edit view

Vote:
 

Hello,

I`m trying to make the following:

User has the ability to edit sku attibutes, but cant edit prices and inventories (we receive them from another system).

I`ve already read https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2015/6/read-only-catalog/

and https://vimvq1987.com/read-catalog-ui-part-1/, but it seems that this approach is not working for prices and stocks.

#198952
Edited, Nov 09, 2018 12:53
Vote:
 

There are several ways to do it, but there is no perfect way. You can simply implement IPriceDetailService and IInventoryService and only allows editing for special account (for example, the "integration account") - or no editing at all.

The ability to set access rights for prices and inventory is a feature in our backlog, but it will not happen anytime soon. 

#198955
Nov 09, 2018 14:43
Vote:
 
#198956
Nov 09, 2018 14:58
Vote:
 

Yes, something like that, you can always check the current user.

#198957
Nov 09, 2018 15:05
Vote:
 

If I understand it correctly, you want to disable the Pricing and Inventories views? You would still be able to see the prices and invetories on the tabs in the All Properties view, but not edit them, since they are read only there.

Would an approach like this work?

http://jakejon.es/blog/restricting-episerver-ui-views-for-a-content-type-based-on-a-users-roles

Regards

Per Gunsarfs

#198958
Nov 09, 2018 15:06
Vote:
 

I wanna remove or at least disable "Edit inventories" link(which is under the sku`s inventories table).

#198959
Nov 09, 2018 15:11
Vote:
 

Good point, I didn't consider that. Just did a quick check even if the view is disabled the "Edit" link under the table is still there. Nothing will happen when you click on it, but I understand why you'd want to remove or disable it.

#198960
Nov 09, 2018 15:21
Vote:
 

I noticed one interesting thing:

1) I opened sku edit view with admin account=> all properties are editable, "Edit prices" and "Edit inventories" are in place.

2) Then I copied this tab and logged out.

3) Logged in as user without access to this catalog.

4) Referesh first tab => all properties are disabled, and !!! there are no "Edit prices" and "Edit inventories" links in corresponding tabs, only tables.

So the problem is that I cant find the logic, why these links are supposed to be hidden in case of insufficient rights.

May be it`s possible to override something on C# code?

#198961
Edited, Nov 09, 2018 15:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.