use of org.neo4j.kernel.api.security.SecurityContext in project neo4j by neo4j.
the class SecurityContextDescriptionTest method shouldMakeNiceDescriptionOverridden.
@Test
public void shouldMakeNiceDescriptionOverridden() throws Throwable {
SecurityContext overridden = context.withMode(new OverriddenAccessMode(context.mode(), AccessMode.Static.READ));
assertThat(overridden.description(), equalTo("user 'johan' with FULL overridden by READ"));
}
use of org.neo4j.kernel.api.security.SecurityContext in project neo4j by neo4j.
the class SecurityContextDescriptionTest method shouldMakeNiceDescriptionFrozen.
@Test
public void shouldMakeNiceDescriptionFrozen() throws Throwable {
SecurityContext frozen = context.freeze();
assertThat(frozen.description(), equalTo("user 'johan' with FULL"));
}
use of org.neo4j.kernel.api.security.SecurityContext in project neo4j by neo4j.
the class SecurityContextDescriptionTest method shouldMakeNiceDescriptionAuthDisabled.
@Test
public void shouldMakeNiceDescriptionAuthDisabled() throws Throwable {
SecurityContext disabled = SecurityContext.AUTH_DISABLED;
assertThat(disabled.description(), equalTo("AUTH_DISABLED with FULL"));
}
use of org.neo4j.kernel.api.security.SecurityContext in project neo4j by neo4j.
the class MultiRealmAuthManagerTest method userWithAdminRoleShouldHaveCorrectPermissions.
@Test
public void userWithAdminRoleShouldHaveCorrectPermissions() throws Throwable {
// Given
createTestUsers();
manager.start();
// When
SecurityContext securityContext = manager.login(authToken("morpheus", "abc123"));
// Then
assertTrue(securityContext.mode().allowsReads());
assertTrue(securityContext.mode().allowsWrites());
assertTrue(securityContext.mode().allowsSchemaWrites());
}
use of org.neo4j.kernel.api.security.SecurityContext in project neo4j by neo4j.
the class MultiRealmAuthManagerTest method userWithNonPredefinedRoleShouldHaveNoPermissions.
@Test
public void userWithNonPredefinedRoleShouldHaveNoPermissions() throws Throwable {
// Given
createTestUsers();
manager.start();
// When
SecurityContext securityContext = manager.login(authToken("smith", "abc123"));
// Then
assertFalse(securityContext.mode().allowsReads());
assertFalse(securityContext.mode().allowsWrites());
assertFalse(securityContext.mode().allowsSchemaWrites());
}
Aggregations