use of org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext in project neo4j by neo4j.
the class EnterpriseSecurityContextDescriptionTest method shouldMakeNiceDescriptionOverridden.
@Test
public void shouldMakeNiceDescriptionOverridden() throws Throwable {
manager.newRole("role1", "mats");
manager.addRoleToUser(PUBLISHER, "mats");
EnterpriseSecurityContext overridden = context.withMode(new OverriddenAccessMode(context.mode(), AccessMode.Static.READ));
assertThat(overridden.description(), equalTo("user 'mats' with roles [publisher,role1] overridden by READ"));
}
use of org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext in project neo4j by neo4j.
the class EnterpriseSecurityContextDescriptionTest method shouldMakeNiceDescriptionRestricted.
@Test
public void shouldMakeNiceDescriptionRestricted() throws Throwable {
manager.newRole("role1", "mats");
manager.addRoleToUser(PUBLISHER, "mats");
EnterpriseSecurityContext restricted = context.withMode(new RestrictedAccessMode(context.mode(), AccessMode.Static.READ));
assertThat(restricted.description(), equalTo("user 'mats' with roles [publisher,role1] restricted to READ"));
}
use of org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext in project neo4j by neo4j.
the class EnterpriseSecurityContextDescriptionTest method shouldMakeNiceDescriptionFrozen.
@Test
public void shouldMakeNiceDescriptionFrozen() throws Throwable {
manager.newRole("role1", "mats");
manager.addRoleToUser(PUBLISHER, "mats");
EnterpriseSecurityContext frozen = context.freeze();
assertThat(frozen.description(), equalTo("user 'mats' with roles [publisher,role1]"));
}
use of org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext in project neo4j by neo4j.
the class EnterpriseSecurityContextDescriptionTest method shouldMakeNiceDescriptionWithMode.
@Test
public void shouldMakeNiceDescriptionWithMode() throws Throwable {
manager.newRole("role1", "mats");
manager.addRoleToUser(PUBLISHER, "mats");
EnterpriseSecurityContext modified = context.withMode(AccessMode.Static.CREDENTIALS_EXPIRED);
assertThat(modified.description(), equalTo("user 'mats' with CREDENTIALS_EXPIRED"));
}
use of org.neo4j.kernel.enterprise.api.security.EnterpriseSecurityContext in project neo4j by neo4j.
the class EnterpriseSecurityContextDescriptionTest method shouldMakeNiceDescriptionAuthDisabled.
@Test
public void shouldMakeNiceDescriptionAuthDisabled() throws Throwable {
EnterpriseSecurityContext disabled = EnterpriseSecurityContext.AUTH_DISABLED;
assertThat(disabled.description(), equalTo("AUTH_DISABLED with FULL"));
}
Aggregations