]> WPIA git - gigi.git/blob - src/org/cacert/gigi/util/AuthorizationContext.java
Clean: use "authorizationContexts"
[gigi.git] / src / org / cacert / gigi / util / AuthorizationContext.java
1 package org.cacert.gigi.util;
2
3 import org.cacert.gigi.dbObjects.CertificateOwner;
4 import org.cacert.gigi.dbObjects.Group;
5 import org.cacert.gigi.dbObjects.User;
6
7 public class AuthorizationContext {
8
9     CertificateOwner target;
10
11     User actor;
12
13     public AuthorizationContext(CertificateOwner target, User actor) {
14         this.target = target;
15         this.actor = actor;
16     }
17
18     public CertificateOwner getTarget() {
19         return target;
20     }
21
22     public User getActor() {
23         return actor;
24     }
25
26     public boolean isInGroup(Group g) {
27         return actor.isInGroup(g);
28     }
29
30     public User getActor(AuthorizationContext ac) {
31         if (ac == null) {
32             return null;
33         }
34         return ac.getActor();
35     }
36 }