use of org.orcid.jaxb.model.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CanRead_When_HaveReadScope_IsLimited_NotSource.
@Test
public void testWork_CanRead_When_HaveReadScope_IsLimited_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_WORKS_READ_LIMITED);
Work work = createWork(Visibility.LIMITED, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
}
use of org.orcid.jaxb.model.v3.dev1.record.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.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CantRead_When_HaveReadScope_IsPrivate_NotSource.
@Test(expected = OrcidVisibilityException.class)
public void testWork_CantRead_When_HaveReadScope_IsPrivate_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.ORCID_WORKS_READ_LIMITED);
Work work = createWork(Visibility.PRIVATE, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
fail();
}
use of org.orcid.jaxb.model.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_CantRead_When_ReadPublicToken_IsLimited_NotSource.
@Test(expected = OrcidAccessControlException.class)
public void testWork_CantRead_When_ReadPublicToken_IsLimited_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.READ_PUBLIC);
Work work = createWork(Visibility.LIMITED, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_1, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
fail();
}
use of org.orcid.jaxb.model.v3.dev1.record.Work in project ORCID-Source by ORCID.
the class OrcidSecurityManager_generalTest method testWork_ThrowException_When_TokenIsForOtherUser_NotSource.
@Test(expected = OrcidUnauthorizedException.class)
public void testWork_ThrowException_When_TokenIsForOtherUser_NotSource() {
SecurityContextTestUtils.setUpSecurityContext(ORCID_1, CLIENT_1, ScopePathType.READ_PUBLIC);
Work work = createWork(Visibility.PUBLIC, CLIENT_2);
orcidSecurityManager.checkAndFilter(ORCID_2, work, ScopePathType.ORCID_WORKS_READ_LIMITED);
fail();
}
Aggregations