cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How i can apply restriction in BackOffice if i want to see only orders for specific site?

0 Likes
909

Hello,

How i can apply restriction for login user on BackOffice if i want to see only orders for specific site/store? and to see just customers already registered on specific site/store?

For Example: Let's see i 2 sites (A & B) and both of them on the same database schema and i want to let A's employees to access the BackOffice and see only A's orders and A's registered customers. and the same for B site.

Accepted Solutions (1)

Accepted Solutions (1)

aimprosoft
Participant

Hello, Saleh.
You can use SearchRestriction as a solution, e.g.:

INSERT_UPDATE SearchRestriction;code[unique=true];name[lang=en];query;principal(UID);restrictedType(code);active;generate
;orderVisibilitySiteA;;{item.site} IN ({{SELECT {site.pk} FROM {BaseSite as site} WHERE {site.uid} = 'siteAUid'}});myEmployeeGroupA;Order;true;true

Same should be done for second employee group. Order also has OOTB store property that you can use.
As for Customers, you can add new property to hold either site or a store and use identical search restriction but change restrictedType to Customer and tweak the query a little bit.

Answers (2)

Answers (2)

0 Likes

Hi sidjainey, Yes it worked as expected. Can you please share you configuration to check it for you?

0 Likes

Thanks a lot! I will try it and let you know if i faced any issue 🙂

0 Likes

Hi Saleh,

Did this worked for you ?

I am unable to see any difference even after applying this search restriction.