Search in sources :

Example 1 with IRoleManager

use of com.agiletec.aps.system.services.role.IRoleManager in project entando-core by entando.

the class RoleAction method delete.

public String delete() {
    try {
        String result = this.checkRoleForDelete();
        if (null != result)
            return result;
        IRoleManager roleManager = this.getRoleManager();
        Role role = roleManager.getRole(this.getName());
        roleManager.removeRole(role);
    } catch (Throwable t) {
        _logger.error("error in delete", t);
        return FAILURE;
    }
    return SUCCESS;
}
Also used : Role(com.agiletec.aps.system.services.role.Role) IRoleManager(com.agiletec.aps.system.services.role.IRoleManager)

Example 2 with IRoleManager

use of com.agiletec.aps.system.services.role.IRoleManager in project entando-core by entando.

the class TestApplicationContext method testGetServices.

public void testGetServices() {
    ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
    assertNotNull(configManager);
    ICacheInfoManager cacheInfoManager = (ICacheInfoManager) this.getService(SystemConstants.CACHE_INFO_MANAGER);
    assertNotNull(cacheInfoManager);
    ILangManager langManager = (ILangManager) this.getService(SystemConstants.LANGUAGE_MANAGER);
    assertNotNull(langManager);
    IWidgetTypeManager showletTypeManager = (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
    assertNotNull(showletTypeManager);
    IPageModelManager pageModelManager = (IPageModelManager) this.getService(SystemConstants.PAGE_MODEL_MANAGER);
    assertNotNull(pageModelManager);
    IPageManager pageManager = (IPageManager) this.getService(SystemConstants.PAGE_MANAGER);
    assertNotNull(pageManager);
    IRoleManager roleManager = (IRoleManager) this.getService(SystemConstants.ROLE_MANAGER);
    assertNotNull(roleManager);
    IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
    assertNotNull(userManager);
    IURLManager urlManager = (IURLManager) this.getService(SystemConstants.URL_MANAGER);
    assertNotNull(urlManager);
    II18nManager i18nManager = (II18nManager) this.getService(SystemConstants.I18N_MANAGER);
    assertNotNull(i18nManager);
    // ControllerManager controller = (ControllerManager) this.getService(SystemConstants.CONTROLLER_MANAGER);
    // assertNotNull(controller);
    IKeyGeneratorManager keyGeneratorManager = (IKeyGeneratorManager) this.getService(SystemConstants.KEY_GENERATOR_MANAGER);
    assertNotNull(keyGeneratorManager);
    ICategoryManager categoryManager = (ICategoryManager) this.getService(SystemConstants.CATEGORY_MANAGER);
    assertNotNull(categoryManager);
}
Also used : IPageManager(com.agiletec.aps.system.services.page.IPageManager) ICacheInfoManager(org.entando.entando.aps.system.services.cache.ICacheInfoManager) IWidgetTypeManager(org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager) IPageModelManager(com.agiletec.aps.system.services.pagemodel.IPageModelManager) ILangManager(com.agiletec.aps.system.services.lang.ILangManager) IUserManager(com.agiletec.aps.system.services.user.IUserManager) IRoleManager(com.agiletec.aps.system.services.role.IRoleManager) IURLManager(com.agiletec.aps.system.services.url.IURLManager) ConfigInterface(com.agiletec.aps.system.services.baseconfig.ConfigInterface) IKeyGeneratorManager(com.agiletec.aps.system.services.keygenerator.IKeyGeneratorManager) II18nManager(com.agiletec.aps.system.services.i18n.II18nManager) ICategoryManager(com.agiletec.aps.system.services.category.ICategoryManager)

Example 3 with IRoleManager

use of com.agiletec.aps.system.services.role.IRoleManager in project entando-core by entando.

the class RoleAction method isRoleInUse.

/**
 * Verifica l'utilizzo del ruolo.
 * @return true in caso positivo, false nel caso il ruolo non sia utilizzato.
 * @throws ApsSystemException In caso di errore.
 */
protected boolean isRoleInUse() throws ApsSystemException {
    IRoleManager roleManager = this.getRoleManager();
    Role role = roleManager.getRole(this.getName());
    List<String> usernames = super.getAuthorizationManager().getUsersByRole(role, false);
    this.setReferences(usernames);
    return (null != usernames && !usernames.isEmpty());
}
Also used : Role(com.agiletec.aps.system.services.role.Role) IRoleManager(com.agiletec.aps.system.services.role.IRoleManager)

Aggregations

IRoleManager (com.agiletec.aps.system.services.role.IRoleManager)3 Role (com.agiletec.aps.system.services.role.Role)2 ConfigInterface (com.agiletec.aps.system.services.baseconfig.ConfigInterface)1 ICategoryManager (com.agiletec.aps.system.services.category.ICategoryManager)1 II18nManager (com.agiletec.aps.system.services.i18n.II18nManager)1 IKeyGeneratorManager (com.agiletec.aps.system.services.keygenerator.IKeyGeneratorManager)1 ILangManager (com.agiletec.aps.system.services.lang.ILangManager)1 IPageManager (com.agiletec.aps.system.services.page.IPageManager)1 IPageModelManager (com.agiletec.aps.system.services.pagemodel.IPageModelManager)1 IURLManager (com.agiletec.aps.system.services.url.IURLManager)1 IUserManager (com.agiletec.aps.system.services.user.IUserManager)1 ICacheInfoManager (org.entando.entando.aps.system.services.cache.ICacheInfoManager)1 IWidgetTypeManager (org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager)1