use of org.orcid.jaxb.model.record_rc3.Work in project ORCID-Source by ORCID.
the class SourceInActivitiesTest method getWorkWithoutTitle.
private Work getWorkWithoutTitle(String userOrcid2, boolean validate) {
Work work = new Work();
work.setWorkType(org.orcid.jaxb.model.record_v2.WorkType.BOOK);
ExternalID extId = new ExternalID();
extId.setValue("111");
extId.setType(WorkExternalIdentifierType.DOI.value());
ExternalIDs extIdentifiers = new ExternalIDs();
extIdentifiers.getExternalIdentifier().add(extId);
work.setWorkExternalIdentifiers(extIdentifiers);
work = workManager.createWork(userOrcid, work, validate);
return workManager.getWork(userOrcid, work.getPutCode(), 0L);
}
use of org.orcid.jaxb.model.record_rc3.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CanRead_When_DontHaveReadScope_IsPublic_NotSource.
@Test
public void testWork_CanRead_When_DontHaveReadScope_IsPublic_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_WORKS_CREATE);
Work work = createWork(Visibility.PUBLIC, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
}
use of org.orcid.jaxb.model.record_rc3.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CanRead_When_IsSource.
@Test
public void testWork_CanRead_When_IsSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.READ_PUBLIC);
Work work = createWork(Visibility.PUBLIC, CLIENT_1);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
work = createWork(Visibility.LIMITED, CLIENT_1);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
work = createWork(Visibility.PRIVATE, CLIENT_1);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
}
use of org.orcid.jaxb.model.record_rc3.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CanRead_When_ReadPublicToken_IsPublic_NotSource.
@Test
public void testWork_CanRead_When_ReadPublicToken_IsPublic_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.READ_PUBLIC);
Work work = createWork(Visibility.PUBLIC, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
}
use of org.orcid.jaxb.model.record_rc3.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CantRead_When_DontHaveReadScope_IsLimited_NotSource.
@Test(expected = OrcidAccessControlException.class)
public void testWork_CantRead_When_DontHaveReadScope_IsLimited_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_WORKS_CREATE);
Work work = createWork(Visibility.LIMITED, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
fail();
}
Aggregations