public void SimpleAddStoreManager() { User aviad = us.startSession(); us.register(aviad, "aviad", "123456"); us.login(aviad, "aviad", "123456"); int storeid = ss.createStore("abowim", zahi); Store store = StoreManagement.getInstance().getStore(storeid); LinkedList <StoreManager> managers = store.getManagers(); Assert.AreEqual(managers.Count, 0); ss.addStoreManager(store.getStoreId(), "aviad", zahi); managers = store.getManagers(); Assert.AreEqual(managers.Count, 1); StoreManager SM = managers.First.Value; Assert.AreEqual(SM.getUser().getUserName(), aviad.getUserName()); Assert.AreEqual(SM.getStore(), store); Premissions SP = SM.getPremissions(aviad, store); Dictionary <string, Boolean> Dict = SP.getPrivileges(); foreach (KeyValuePair <string, Boolean> entry in Dict) { Assert.IsFalse(entry.Value); } }
public bool HasPremission(string action) { return Premissions.Contains(action); }