@Override protected Resource getRoot() throws IOException { return role(); } }
/** Lists all available role service configurations. */ public SortedSet<String> listRoleServices() throws IOException { return listFiles(role()); }
/** The root configuration for the role service. */ public Resource getConfigRoot() throws IOException { return getSecurityManager().role().get(getName()); }
/** The root configuration for the role service. */ public Resource getConfigRoot() throws IOException { return getSecurityManager().role().get(getName()); }
/** * Additional Validation. Removing this configuration may also remove the file where the roles * are contained. (the file may be stored within the configuration sub directory). The design * insists on an empty role file. */ @Override public void validateRemoveRoleService(SecurityRoleServiceConfig config) throws SecurityConfigException { super.validateRemoveRoleService(config); XMLRoleServiceConfig xmlConfig = (XMLRoleServiceConfig) config; File file = new File(xmlConfig.getFileName()); // check if if file name is absolute and not in standard role directory try { if (file.isAbsolute() && !file.getCanonicalPath() .startsWith( manager.role().get(config.getName()).dir().getCanonicalPath() + File.separator)) return; // file in security sub dir, check if roles exists if (manager.loadRoleService(config.getName()).getRoleCount() > 0) { throw createSecurityException(ROLE_SERVICE_NOT_EMPTY_$1, config.getName()); } } catch (IOException e) { throw new RuntimeException(); } }
if (role().getType() != Type.UNDEFINED) { Resource oldUserFile = security().get("users.properties.old"); if (oldUserFile.getType() != Type.UNDEFINED) {
expect(secMgr.getActiveRoleService()).andReturn(activeRoleService).anyTimes(); expect(secMgr.role()).andReturn(Files.asResource(tempFolder.getRoot())).anyTimes(); XMLRoleService.class, XMLRoleService.DEFAULT_LOCAL_ADMIN_ROLE, new File(getSecurityManager().role().dir(), "test3.xml") .getAbsolutePath()); try {