use of org.orcid.jaxb.model.record_rc1.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_rc1.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_rc1.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_rc1.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();
}
use of org.orcid.jaxb.model.record_rc1.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();
}
Aggregations