Okay, there is one thing that should have never been attached to the shop : Select Unit Ability
Use Shop Sharing Instead, I show you an attachment, try become player 2 (blue) and you can't buy the troop at the modified barrack and then try player 3 (teal) and you should be able to buy Footman Rifleman and Knights (notes I made Player 2 and 3 are allied and make player 1 treat player 2 as enemy and vice versa and make player 3 treated as allies for P1 and vice versa)
So, to be simple, replace "Select Unit" with "Shop Sharing" then set the range to 99999 (dunno if Shop Sharing Range is editable though)
EDIT : I found out that Shop Sharing range is editable, try the one that has with 99999 range for Shop Sharing.
NOTES : It seems the "Select Unit" ability is bugged, it always treat all players equal wether they are allies nor enemies, therefore "Shop Sharing" is handy for this kind of situation.
I don't know about this...... Maybe.... or Maybe not, did you try it already KillerZone? Don't just throw some random answer, it is sometime makes the one who asked get more confused
OTHER : I can't believe the solution is actually simple
and all I have to do is checking Arcane Vault ability which only allows ally to buy items from it
Regards,
Daffa the Mage
Hive Mage