]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/CertificateProfile.java
upd: split certificate issuance as organisation into seperate
[gigi.git] / src / org / cacert / gigi / dbObjects / CertificateProfile.java
index 3a04090310f889f4c85a325f4d4b4217c5b6996c..0e6f29bac09b0dec6f641910a6414e2d4c0e8c00 100644 (file)
@@ -237,18 +237,27 @@ public class CertificateProfile implements IdCachable {
         return byId.values().toArray(new CertificateProfile[byId.size()]);
     }
 
-    public boolean canBeIssuedBy(User u) {
+    public boolean canBeIssuedBy(CertificateOwner owner, User actor) {
+        if (pt.containsKey("orga")) {
+            if ( !(owner instanceof Organisation)) {
+                return false;
+            }
+        } else {
+            if (owner instanceof Organisation) {
+                return false;
+            }
+        }
         for (String s : req) {
             if (s.equals("points>=50")) {
-                if (u.getAssurancePoints() < 50) {
+                if (actor.getAssurancePoints() < 50) {
                     return false;
                 }
             } else if (s.equals("points>=100")) {
-                if (u.getAssurancePoints() < 100) {
+                if (actor.getAssurancePoints() < 100) {
                     return false;
                 }
             } else if (s.equals("codesign")) {
-                if (u.isInGroup(Group.CODESIGNING)) {
+                if (actor.isInGroup(Group.CODESIGNING)) {
                     return false;
                 }
             } else {