add: ensure that for Org Agent actions certificate login is used
[gigi.git] / src / club / wpia / gigi / pages / orga / CreateOrgPage.java
1 package club.wpia.gigi.pages.orga;
2
3 import java.io.IOException;
4
5 import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse;
7
8 import club.wpia.gigi.dbObjects.Group;
9 import club.wpia.gigi.pages.ManagedFormPage;
10 import club.wpia.gigi.util.AuthorizationContext;
11
12 public class CreateOrgPage extends ManagedFormPage {
13
14     public static final Group ORG_AGENT = Group.ORG_AGENT;
15
16     public static final String DEFAULT_PATH = "/orga/new";
17
18     public CreateOrgPage() {
19         super("Create Organisation", CreateOrgForm.class);
20     }
21
22     @Override
23     public boolean isPermitted(AuthorizationContext ac) {
24         return ac != null && ac.isInGroup(ORG_AGENT) && ac.isStronglyAuthenticated();
25     }
26
27     @Override
28     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
29         new CreateOrgForm(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
30     }
31 }