]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/Organisation.java
add: Org Agents may not make themselves administrators of organisations.
[gigi.git] / src / club / wpia / gigi / dbObjects / Organisation.java
index c47a7837ba3cbda87d7cb83390bd2d73194faf92..3ce83c70b77ed3312827f977a0007010a4e0a74b 100644 (file)
@@ -145,6 +145,9 @@ public class Organisation extends CertificateOwner {
     }
 
     public synchronized void addAdmin(User admin, User actor, boolean master) throws GigiApiException {
+        if (actor == admin) {
+            throw new GigiApiException("You may not add yourself as Organisation Admin. Ask another Organisation Agent to do so.");
+        }
         if ( !admin.canVerify()) {
             throw new GigiApiException("Cannot add person who is not RA Agent.");
         }