@MethodFilter public List<ShareUser> removeSharedUser(int userId) { View view = Common.getUser().getView(); for (ShareUser su : view.getViewUsers()) { if (su.getUserId() == userId) { view.getViewUsers().remove(su); break; } } return view.getViewUsers(); }
// // View users // @MethodFilter public List<ShareUser> addUpdateSharedUser(int userId, int accessType) { View view = Common.getUser().getView(); boolean found = false; for (ShareUser su : view.getViewUsers()) { if (su.getUserId() == userId) { found = true; su.setAccessType(accessType); break; } } if (!found) { ShareUser su = new ShareUser(); su.setUserId(userId); su.setAccessType(accessType); view.getViewUsers().add(su); } return view.getViewUsers(); }