import org.cacert.gigi.output.template.Form;
import org.cacert.gigi.output.template.IterableDataset;
import org.cacert.gigi.pages.Page;
+import org.cacert.gigi.util.AuthorizationContext;
public class SupportUserDetailsPage extends Page {
int id = -1;
String[] idP = req.getPathInfo().split("/");
try {
- if (req.getPathInfo().endsWith("history") || req.getPathInfo().endsWith("trainings")) {
- id = Integer.parseInt(idP[idP.length - 2]);
- } else {
- id = Integer.parseInt(idP[idP.length - 1]);
- }
+ id = Integer.parseInt(idP[idP.length - 1]);
} catch (NumberFormatException e) {
resp.sendError(404);
}
}
@Override
- public boolean isPermitted(User u) {
- if (u == null) {
- return false;
- }
- return u.isInGroup(Group.SUPPORTER);
+ public boolean isPermitted(AuthorizationContext ac) {
+ return ac != null && ac.isInGroup(Group.SUPPORTER);
}
}