Package framework.generic

Examples of framework.generic.ESecurity


            if (entity.getSerial() == null || entity.getSerial().trim().isEmpty()) {
                throw new EDataIntegrity("Запрещено закрывать больничный без серийного номера");
            }
      entity.setDateToWork(d.dateToWork);
            if (d.closerID != getCollaboratorId() && !isSuperUser()){
                throw new ESecurity("Запрещено указывать другого пользователя при продлении");
            }

            entity.setCloser(findEntity(Collaborator.class, d.closerID));
            entity.setComment(d.comment);
            entity.setSerrenClosed(d.serrenCloseID == 0 ? null : findEntity(ServiceRender.class, d.serrenCloseID));
View Full Code Here


                //Сохранение новой сущности продления
                SickLong sickLong = new SickLong();
                AuditDoc<SickLong> auditDoc = new AuditDoc<SickLong>(sickLong, getCollaborator());
                sickLong.setSicklist(entity);
        if (sickLongDetails.collID != getCollaboratorId() && !isSuperUser()){
          throw new ESecurity("Запрещено указывать другого пользователя при продлении");
        }
                sickLong.setCollaborator(findEntity(Collaborator.class, sickLongDetails.collID));
                sickLong.setDate(sickLongDetails.date);
                sickLong.setSerren(findEntity(ServiceRender.class, sickLongDetails.serrenID));
                entity.addSickLong(sickLong);
View Full Code Here

            throw new ClipsServerException("Не указан источник финансирования");
        }

        if(entity.getId() != 0) {
            if(entity.getServiceRender().getId() != d.serviceRenderID) {
                throw new ESecurity("Cмена услуги недопустима");
            }
        }
        entity.setDrug(findEntity(DloDrugList.class, d.drugID));
        entity.setServiceRender(findEntity(ServiceRender.class, d.serviceRenderID));
        entity.setDiagnosis(findEntity(Diagnosis.class, d.diagnosisId));
View Full Code Here

        if (details.getId() != 0) {
            //Проверка на модификацию только своей клиники
            Collaborator collab = findEntity(Collaborator.class, getCollaboratorId());
            if (collab.getLpu().getId() != lpu.getId()
                    && RightPresence(UserRightsSet.WRITE_REGION_ADMIN_DIRECTORY.id) < 0) {
                throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_REGION_ADMIN_DIRECTORY.id));
            }
        }

        lpu.setTitle(d.title);
        lpu.setTitleShort(d.title_short);
View Full Code Here

                throw new EDataIntegrity("Нельзя создавать сразу закрытые заболевания");
            }
            //d.created может быть нуллом
            if (!DateTimeUtils.belongsToCurrentDay(d.created) || d.collaboratorID != getCollaboratorId()) {
                if (!hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA) && !isSuperUser()) {
                    throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA.id));
                }
            }
            entity.setCreated(d.created);
            entity.setDateReg(d.dateReg);
            entity.setExtKey(d.extKey == 0 ? null : d.extKey);
View Full Code Here

        return rights.isCommandAccessible(aCommandId);
    }

    protected final void checkAuthentic() throws ESecurity {
        if (!isAuthentic()) {
            throw new ESecurity(SecurityChecker.msgClientIsNotAuthentic);
        }
    }
View Full Code Here

    protected final void checkCommandAccessibility(int aCommandId) throws ESecurity {
        checkAuthentic();

        int r = rights.getCommandAccessReason(aCommandId);
        if (UserRightsSetAbstract.SecurityOn && r < 0) {
            throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(r));
        }
    }
View Full Code Here

     */
    protected void throwNeedAdminSecurityException(String str) throws ESecurity {
        if (sessionData.isSuperUser) {
            return;
        }
        throw new ESecurity(str);
    }
View Full Code Here

     * Записывает документ аудита в базу, если изменений не было возвращент null
     * @param auditDoc
     */
    protected AuditDetails persistAudit(AuditDoc auditDoc) throws ESecurity {
        if (!auditDoc.isChecked()) {
            throw new ESecurity("В документе аудита не была произведена проверка изменений");
        }
        if (auditDoc.getResult() == null) {
            return null;
        }
        Audit audit = new Audit();
View Full Code Here

            }
        }
       
        //сравниваем
        if (createMask(rts) != mask){
            throw new ESecurity("Попытка установить невозможную комбинацию прав: " + mask);
        }
       
        return rts;
    }
View Full Code Here

TOP

Related Classes of framework.generic.ESecurity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.