]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/AuthorizationContext.java
upd: prevent supporter and org-actor at same time
[gigi.git] / src / org / cacert / gigi / util / AuthorizationContext.java
index 16f458cafd09d934d29686acfab91ce4caac0a80..412ebc5a66e18872571f70c7d33c47c583802333 100644 (file)
@@ -24,6 +24,15 @@ public class AuthorizationContext implements Outputable {
         this.actor = actor;
     }
 
+    public AuthorizationContext(User actor, String supporterTicket) throws GigiApiException {
+        this.target = actor;
+        this.actor = actor;
+        if ( !isInGroup(Group.SUPPORTER)) {
+            throw new GigiApiException("requires a supporter");
+        }
+        supporterTicketId = supporterTicket;
+    }
+
     public CertificateOwner getTarget() {
         return target;
     }
@@ -43,13 +52,6 @@ public class AuthorizationContext implements Outputable {
         return ac.getActor();
     }
 
-    public void setSupporterTicketId(String supporterTicketId) throws GigiApiException {
-        if ( !isInGroup(Group.SUPPORTER)) {
-            throw new GigiApiException("requires a supporter");
-        }
-        this.supporterTicketId = supporterTicketId;
-    }
-
     public String getSupporterTicketId() {
         return supporterTicketId;
     }