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