Examples of AccessDenied


Examples of com.infoclinika.mssharing.model.AccessDenied

    @Override
    public  InstrumentRequestDetails myInstrumentInboxDetails(long actor, long instrumentId, final long requester) {
        final Instrument instrument = checkPresence(instrumentRepository.findOne(instrumentId));
        final User user = checkPresence(userRepository.findOne(requester));
        if(!instrument.isOperator(Util.USER_FROM_ID.apply(actor))) {
            throw new AccessDenied("User is not an operator of instrument");
        }
        Set<PendingOperator> pendingOperators = instrument.getPending();
        if(pendingOperators.size() == 0) {
            throw new ObjectNotFoundException();
        }
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    }

    @Override
    public ImmutableSortedSet<DashboardReader.LabLine> readAllLabs(long actor) {
        if (!ruleValidator.canReadLabs(actor)) {
            throw new AccessDenied("User should be admin to read labs list");
        }
        return from(labRepository.findAll()).filter(new Predicate<Lab>() {
            @Override
            public boolean apply(Lab input) {
                return !input.isFake();
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    }

    @Override
    public ImmutableSet<ExperimentTranslationShortItem> readExperimentTranslationStatuses(long actor) {
        if (!ruleValidator.userCanReadExperimentTranslationStatuses(actor)) {
            throw new AccessDenied("The user cannot read experiment translation statuses. User ID = " + actor);
        }
        return from(experimentRepository.findAll(new Sort("name")))
                .transform(transformers.experimentTranslationItemTransformer())
                .toImmutableSet();
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    }

    @Override
    public ImmutableSet<ExperimentSearchLine> readExperimentSearchStatuses(long actor) {
        if (!ruleValidator.userCanReadExperimentSearchStatuses(actor)) {
            throw new AccessDenied("The user cannot read experiment search statuses. User ID = " + actor);
        }
        return from(experimentSearchRepository.findAll(new Sort("data")))
                .transform(TO_EXPERIMENT_SEARCH_DTO).toImmutableSet();
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    @Override
    public ExperimentItem readExperiment(long actor, final long experimentId) {
        final Experiment experiment = experimentRepository.findOne(experimentId);
        if(experiment == null) throw new ObjectNotFoundException("Experiment not found");

        if(!ruleValidator.isUserCanReadExperiment(actor).apply(experiment)) throw new AccessDenied("Can't read experiment");

        final String msChartsLink = transformers.getChartsLink(experiment);
        final InstrumentModel instrumentModel = experiment.getInstrumentRestriction().getInstrumentModel();
        final Instrument instrument = experiment.getInstrumentRestriction().getInstrument();
        final ImmutableList<FactorItem> factors = from(experiment.rawFiles.getFilteredFactors()).transform(new Function<Factor, FactorItem>() {
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    @Override
    public ExperimentSearchItem readExperimentSearch(long actor, long experimentSearchId) {
        final ExperimentSearch search = experimentSearchRepository.findOne(experimentSearchId);
        if(search == null) throw new ObjectNotFoundException("Experiment search is not found");

        if(!ruleValidator.isUserCanReadExperimentSearch(actor, experimentSearchId)) throw new AccessDenied("Can't read experiment search");
        final ExperimentSearchParamsItem params = getExperimentSearchItemsParams(search);
        final List<RawFile> rawFiles = experimentSearchRepository.findRawFilesByExperimentSearch(experimentSearchId);
        final List<Long> filesId = transform(rawFiles, new Function<RawFile, Long>() {
            @Override
            public Long apply(RawFile rawFile) {
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    @Override
    public FileReference readExperimentSearchExport(long actor, long experimentSearchId, long fileId, ExportType exportType) {
        final ExperimentSearch search = experimentSearchRepository.findOne(experimentSearchId);
        if (!ruleValidator.isUserCanReadExperimentSearch(actor, experimentSearchId)){
            throw new AccessDenied("User doesn't have access to read experiment search");
        }
        for (SearchRun searchRun : search.getRuns()){
            if (searchRun.getFile().getFileMetaData().getId().equals(fileId)){
                switch (exportType){
                    case MS2:
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    }

    @Override
    public LabItem readLabRequestDetails(long actor, long labCreationRequestId) {
        if (!ruleValidator.canReadLabs(actor)) {
            throw new AccessDenied("User should be admin to read lab request details");
        }
        final LabCreationRequest request = checkNotNull(labCreationRequestRepository.findOne(labCreationRequestId));
        return LAB_REQUEST_ITEM_FUNCTION.apply(request);
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    }

    @Override
    public LabItem readLabDetails(long actor, long labId) {
        if (!ruleValidator.canReadLabs(actor)) {
            throw new AccessDenied("User should be admin to read lab details");
        }
        final Lab lab = checkNotNull(labRepository.findOne(labId));
        final LabItem labItem = LAB_ITEM_FUNCTION.apply(lab);
        labItem.membersCount = labRepository.membersCount(lab);
        return labItem;
View Full Code Here

Examples of com.infoclinika.mssharing.model.AccessDenied

    @Override
    public ProjectItem readProject(long user, long projectId) {
        final Project project = projectRepository.findOne(projectId);
        if(project == null) throw new ObjectNotFoundException("Project not found");
        if (!ruleValidator.hasReadAccessOnProject(user, projectId)) throw new AccessDenied("Project read restricted");
        return new ProjectItem(project.getId(),
                (project.getLab() == null) ? null : project.getLab().getId(),
                project.getName(),
                project.getCreator().getEmail(),
                project.getAreaOfResearch(),
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.