@Override public List<AbstractDomain> getMyAdministredDomains(Account actor) { if (!(actor.hasAdminRole() || actor.hasSuperAdminRole())) { return Lists.newArrayList(); } return findRecursivelyDomains(actor.getDomain()); }
@Override public boolean isAdminforThisDomain(Account actor, AbstractDomain domain) { if (!(actor.hasSuperAdminRole() || actor.hasSystemAccountRole())) { if (!domain.isManagedBy(actor)) { return false; } } return true; }
@Override public UploadPropositionFilter find(Account actor, String uuid) throws BusinessException { preChecks(actor); Validate.notEmpty(uuid, "filter uuid is required"); UploadPropositionFilter filter = businessService.find(uuid); if (filter == null) { logger.error( actor.getAccountReprentation() + " is looking for missing filter uuid : " + uuid); throw new BusinessException("filter uuid not found."); } return filter; }
void preChecks(Account actor) { Validate.notNull(actor, "actor is required"); Validate.notEmpty(actor.getLsUuid(), "actor uuid is required"); }