Examples of PermissionOption


Examples of org.hibernate.ogm.test.options.examples.PermissionOption

  public void shouldProvideNonUniqueOptionValueFromPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here

Examples of org.hibernate.ogm.test.options.examples.PermissionOption

  public void shouldProvideAllValuesForNonUniqueOptionFromPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here

Examples of org.hibernate.ogm.test.options.examples.PermissionOption

  public void shouldIgnoreValuesFromEntityWhenGettingAllValuesForNonUniqueOptionWhenValuesPresentOnPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );
    optionsServiceContext.addEntityOption( entityType, new PermissionOption( "admin" ), "read,write,delete" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.