Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Test studies w/out I2b2Secure are public
Browse files Browse the repository at this point in the history
  • Loading branch information
cataphract committed Jul 17, 2014
1 parent 457250a commit cde3a6c
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -12,6 +12,7 @@ import org.transmartproject.core.querytool.Panel
import org.transmartproject.core.querytool.QueryDefinition
import org.transmartproject.core.querytool.QueryResult
import org.transmartproject.core.users.ProtectedResource
import org.transmartproject.db.ontology.I2b2Secure

import static groovy.util.GroovyAssert.shouldFail
import static org.hamcrest.MatcherAssert.assertThat
Expand Down Expand Up @@ -147,6 +148,18 @@ class UserAccessLevelTests {
assertThat fifthUser.canPerform(SHOW_SUMMARY_STATISTICS, getStudy(STUDY2)), is(true)
}

@Test
void testStudyWithoutI2b2Secure() {
// such a study should be treated as public
// fourth user has no access to study 2
def fourthUser = accessLevelTestData.users[3]

I2b2Secure.findByFullName(getStudy(STUDY2).ontologyTerm.fullName).
delete(flush: true)

assertThat fourthUser.canPerform(API_READ, getStudy(STUDY2)), is(true)
}

@Test
void testQueryDefinitionUserHasAccessToOnePanelButNotAnother() {
// it's enough to have access to one panel
Expand Down

0 comments on commit cde3a6c

Please sign in to comment.