Search in sources :

Example 1 with ApplicationTenancyLevel

use of org.estatio.dom.valuetypes.ApplicationTenancyLevel in project estatio by estatio.

the class Api method putApplicationTenancy.

// //////////////////////////////////////
@ActionSemantics(Of.IDEMPOTENT)
public void putApplicationTenancy(@Named("path") final String path, @Named("name") final String name) {
    ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(path);
    if (applicationTenancy == null) {
        final ApplicationTenancyLevel parentLevel = ApplicationTenancyLevel.of(path).parent();
        final ApplicationTenancy parentApplicationTenancy = parentLevel != null ? applicationTenancies.findTenancyByPath(parentLevel.getPath()) : null;
        applicationTenancy = applicationTenancies.newTenancy(name, path, parentApplicationTenancy);
    }
    applicationTenancy.setName(name);
    // TODO: EST-467, to remove
    getContainer().flush();
}
Also used : ApplicationTenancyLevel(org.estatio.dom.valuetypes.ApplicationTenancyLevel) ApplicationTenancy(org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)

Aggregations

ApplicationTenancyLevel (org.estatio.dom.valuetypes.ApplicationTenancyLevel)1 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)1