Search in sources :

Example 1 with RawUser

use of com.odysseusinc.arachne.portal.model.RawUser in project ArachneCentralAPI by OHDSI.

the class BaseArachneSecureServiceImpl method checkDataNodeAdmin.

public boolean checkDataNodeAdmin(ArachneUser user, DataNode dataNode) {
    final RawUser standardUser = new RawUser();
    standardUser.setUsername(user.getUsername());
    return dataNodeUserRepository.findByDataNodeAndUser_Username(dataNode, standardUser.getUsername()).isPresent();
}
Also used : RawUser(com.odysseusinc.arachne.portal.model.RawUser)

Example 2 with RawUser

use of com.odysseusinc.arachne.portal.model.RawUser in project ArachneCentralAPI by OHDSI.

the class PaperSpecification method getUserStudyLinkSubquery.

protected Subquery<UserStudyExtended> getUserStudyLinkSubquery(CriteriaQuery<?> query, CriteriaBuilder cb, Path<Long> studyId) {
    final Subquery<UserStudyExtended> userStudyExtendedLinkSubquery = query.subquery(UserStudyExtended.class);
    final Root<UserStudyExtended> userStudyLinkRoot = userStudyExtendedLinkSubquery.from(UserStudyExtended.class);
    userStudyExtendedLinkSubquery.select(userStudyLinkRoot);
    final Path<RawUser> linkUser = userStudyLinkRoot.get(UserStudyExtended_.user);
    final Path<Study> linkStudy = userStudyLinkRoot.get(UserStudyExtended_.study);
    final Path<Long> linkStudyId = linkStudy.get(Study_.id);
    final Path<ParticipantStatus> linkStatus = userStudyLinkRoot.get(UserStudyExtended_.status);
    Predicate userStudyPredicate = cb.and(cb.equal(linkUser, user), cb.equal(linkStudyId, studyId));
    userStudyPredicate = cb.and(userStudyPredicate, cb.notEqual(linkStatus, ParticipantStatus.DELETED));
    userStudyExtendedLinkSubquery.where(userStudyPredicate);
    return userStudyExtendedLinkSubquery;
}
Also used : Study(com.odysseusinc.arachne.portal.model.Study) ParticipantStatus(com.odysseusinc.arachne.portal.model.ParticipantStatus) RawUser(com.odysseusinc.arachne.portal.model.RawUser) UserStudyExtended(com.odysseusinc.arachne.portal.model.UserStudyExtended) Predicate(javax.persistence.criteria.Predicate)

Example 3 with RawUser

use of com.odysseusinc.arachne.portal.model.RawUser in project ArachneCentralAPI by OHDSI.

the class UsersOperationsServiceTest method setUp.

@Before
public void setUp() {
    userA = new RawUser();
    userA.setId(1L);
    userB = new RawUser();
    userB.setId(2L);
    usersIdsStub = Collections.emptyList();
}
Also used : RawUser(com.odysseusinc.arachne.portal.model.RawUser) Before(org.junit.Before)

Aggregations

RawUser (com.odysseusinc.arachne.portal.model.RawUser)3 ParticipantStatus (com.odysseusinc.arachne.portal.model.ParticipantStatus)1 Study (com.odysseusinc.arachne.portal.model.Study)1 UserStudyExtended (com.odysseusinc.arachne.portal.model.UserStudyExtended)1 Predicate (javax.persistence.criteria.Predicate)1 Before (org.junit.Before)1