subdomains to pacdomain are not allowed

This commit is contained in:
Peter Hormanns 2012-01-04 14:46:45 +00:00
parent b82497d4fb
commit 9188fd5e42

View File

@ -108,6 +108,9 @@ public class DomainModuleImpl extends AbstractModuleImpl {
List<?> resultList = domainQuery.getResultList();
if (resultList.size() > 0) {
Domain superDom = (Domain) resultList.get(0);
if (superDom.isPacDomain()) {
throw new HSAdminException("subdomains to pacdomain " + superDom.getName() + " are not allowed");
}
if (loginUser.hasPacAdminRoleFor(superDom.getUser().getPac())) {
break; // same pac
}
@ -118,7 +121,7 @@ public class DomainModuleImpl extends AbstractModuleImpl {
if (dnsCheck.checkDomain(dom.getName())) {
break;
} else {
throw new HSAdminException("domain " + dom.getName() + " is not delegated to " + dom.getDnsMaster());
throw new AuthorisationException(loginUser, "add", dom);
}
}
}