public void remove(SubscribedUser role) { StoreRole sr = role.getStoreRole(store); DBStore.getInstance().removeStoreRole(sr); if (sr == null) { throw new RoleException("user " + role.getUsername() + " doesn't have a role in store " + store.getStoreName()); } if (sr.getAppointedBy() != this.user) { throw new RoleException("user " + user.getUsername() + " didn't appoint " + role.getUsername()); } sr.removeAllAppointedBy(); role.removeStoreRole(sr); store.removeStoreRole(sr); }