XMLRepo repo = XMLRepo.instance(pageContext);
String uid = request.getParameter("uid");
String pid = request.getParameter("pid");
long permVal = 0; try { permVal = Long.parseLong(request.getParameter("pval")); } catch (Exception e) {}
boolean isauth = !"false".equals(request.getParameter("isauth"));
if ((uid != null) && (pid != null) && (permVal != 0)) {
Project project = (Project)repo.get(new Project(pid), false);
User user = project.getMember(uid);
if (project != null && user != null) {
if (isauth) user.setPermissions(user.getPermissions() | permVal);
else if (!isauth) user.setPermissions(user.getPermissions() & ~permVal);
repo.save(project);
out.print("success");
return;
}
}
failed