Examples of ESecurity


Examples of framework.generic.ESecurity

        super.onUpdate(entity, details, auditDoc, auditDocList);
        RecommendationDetails d = (RecommendationDetails) details;

        if(entity.getId() != 0) {
            if(entity.getServiceRender().getId() != d.serviceRenderID) {
                throw new ESecurity("Cмена услуги недопустима");
            }
        } else {
            //never use client date +
            entity.setDate(new Date());
View Full Code Here

Examples of framework.generic.ESecurity

        super.onUpdate(entity, details, auditDoc, auditDocList);
        DirectionDetails d = (DirectionDetails) details;

        if(entity.getId() != 0) {
            if(entity.getServiceRender().getId() != d.serviceRenderID) {
                throw new ESecurity("Cмена услуги недопустима");
            }
        } else {
            //never use client date +
            entity.setDate(new Date());
View Full Code Here

Examples of framework.generic.ESecurity

        return UserRightsSet.WRITE_DEVELOPER_DIRECTORY;
    }

    @Override
    protected void set(Lpu entity, LpuDetails details) throws ClipsServerException {
        throw new ESecurity("Справочник ЛПУ нельзя редактировать данным методом");
    }
View Full Code Here

Examples of framework.generic.ESecurity

        if (getId() != 0) {
            List<Collaborator> list = findEntityList(Collaborator.class, "client.id", getId());
            if (list.size() > 0
                    && (RightPresence(UserRightsSetAbstract.WRITE_COLLABORATOR.getID()) <= 0)
                    && !isSuperUser()) {
                        throw new ESecurity("Отсутствует право изменять данные сотрудников");
            }
        }

        ClientDetails d = (ClientDetails) details;
       
View Full Code Here

Examples of framework.generic.ESecurity

        super.onUpdate(entity, details, auditDoc, auditDocList);
        PrescriptionDetails d = (PrescriptionDetails) details;

        if(entity.getId() != 0) {
            if(entity.getServiceRender().getId() != d.serviceRenderID) {
                throw new ESecurity("Cмена услуги недопустима");
            }
        }
        if (!DateTimeUtils.belongsToCurrentDay(d.date)) {
            throwNeedAdminSecurityException("Попытка подмены даты");
        }
View Full Code Here

Examples of framework.generic.ESecurity

        //date;           //дата назначения услуги - если нет права создавать другим числом то только сегодняшняя дата
        if (DateTimeUtils.belongsToCurrentDay(serrenDetails.date)
                || hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA)) {
            serren.setDate(serrenDetails.date);
        } else {
            throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA.id));
        }

        //renderDate;     //дата оказания - нулл
        if (serrenDetails.renderDate != null) {
            throw new ClipsServerException("Нельзя создавать оказанную услугу");
        } else {
            serren.setRenderedDate(null);
        }

        //discount;        //Скидка в процентах - пофиг, проверка не здесь
        serren.setDiscount(serrenDetails.discount);

        //cancelled;   //флаг отменена - false
        if (serrenDetails.cancelled == true) {
            throw new ClipsServerException("Нельзя создавать отмененную услугу");
        } else {
            serren.setCancelled(serrenDetails.cancelled);
        }

        //repeat;          //повторы услуги - 0
        if (serrenDetails.repeat != 0) {
            throw new ClipsServerException("Нельзя создавать услугу, оказанную повторно");
        } else {
            serren.setRepeat(serrenDetails.repeat);
        }

        //polisID;         // - != 0
        Polis polis;
        if (serrenDetails.polisID == 0) {
            throw new ClipsServerException("Нельзя создавать услугу без указания полиса");
        } else {
            polis = findEntity(Polis.class, serrenDetails.polisID);
            serren.setPolis(polis);
        }

        //collaboratorID;  // - 0
        if (serrenDetails.functionsID != 0) {
            throw new ClipsServerException("Нельзя создавать оказанную услугу");
        } else {
            serren.setFunctions(null);
        }

        //directorID;      // - если нет права создавать от другого имени, то только текущий сотрудник
        if (getCollaboratorId() == serrenDetails.directorID
                || hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA)) {
            Collaborator director = findEntity(Collaborator.class, serrenDetails.directorID);
            serren.setDirector(director);
        } else {
            throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA.id));
        }

        //packetServiceID; // - пофиг
        if (serrenDetails.packetServiceID == 0) {
            serren.setPacketService(null);
View Full Code Here

Examples of framework.generic.ESecurity

        }
    }

    @Override
    protected void set(Collaborator entity, CollaboratorDetails details) throws ClipsServerException {
        throw new ESecurity("Справочник сотрудников нельзя редактировать данным методом");
    }
View Full Code Here

Examples of framework.generic.ESecurity

     * @deprecated nut used throw exception
     */
    @Override
    @Deprecated
    protected void set(CollaboratorFunctions entity, CollaboratorFunctionsDetails details) throws ClipsServerException {
        throw new ESecurity("Справочник исполняемых обязанностей нельзя редактировать данным методом");
    }
View Full Code Here

Examples of framework.generic.ESecurity

        // Основные проверки
        if (entity.getId() != 0 &&
            (entity.getDirector().getId() != d.directorID ||
            entity.getPolis().getId() != d.polisID ||
            entity.getService().getId() != d.serviceID || !entity.getDate().equals(d.date)) && !isAdmin) {
            throw new ESecurity("Изменить поля услуги: направивший сотрудник, " +
                "полис, тип услуги и дату направления на услугу, " +
                "можно только при создании новой услуги или администратору");
        }
        // дополнительные
        if (d.getId() != entity.getId()) {
View Full Code Here

Examples of framework.generic.ESecurity

    protected void onRemove(Sicklist entity, List<AuditDoc> audit) throws ClipsServerException {
        super.onRemove(entity, audit);
        if (entity.getRegistrator() != null &&
                (entity.getRegistrator().getId() != getCollaboratorId() || entity.getOpener().getId() != getCollaboratorId())) {
            if (RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id) < 0) {
                throw new ESecurity("Не возможно удалить выданный на руки больничный лист, нужно как минимум право \"" + UserRightsSet.WRITE_MEDICAL_DATA_ANY_TIME.getDescription() + "\"");
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.