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();
}
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;
}
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();
}
Aggregations