Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 177 → Rev 186

/xservices/trunk/src/java/net/brutex/xservices/security/DirectoryPermission.java
16,7 → 16,9
 
package net.brutex.xservices.security;
 
import org.apache.log4j.Logger;
 
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.util.AntPathMatcher;
 
26,7 → 28,8
*/
public class DirectoryPermission implements Permission {
 
private final Logger logger = Logger.getLogger(DirectoryPermission.class);
private final Logger logger = LogManager.getLogger();
 
private final String path;
 
public DirectoryPermission(String antlikepath) {
/xservices/trunk/src/java/net/brutex/xservices/security/PermissionResolver.java
19,7 → 19,8
import net.brutex.xservices.ws.XmlService;
import net.brutex.xservices.ws.rs.FileInfo;
 
import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.InvalidPermissionStringException;
 
29,7 → 30,7
*/
public class PermissionResolver implements org.apache.shiro.authz.permission.PermissionResolver {
final Logger logger = Logger.getLogger(PermissionResolver.class);
private final Logger logger = LogManager.getLogger();
private final String DELIMITER = "||";
 
@Override
/xservices/trunk/src/java/net/brutex/xservices/security/XServicesRealm.java
17,24 → 17,30
 
package net.brutex.xservices.security;
 
import java.text.ParseException;
import java.util.Collection;
import java.util.Map;
import org.apache.logging.log4j.Logger;
 
import org.apache.log4j.Logger;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
 
import javax.servlet.ServletContext;
 
import org.apache.catalina.core.ApplicationContext;
import org.apache.logging.log4j.LogManager;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.config.Ini;
import org.apache.shiro.io.ResourceUtils;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.realm.text.IniRealm;
import org.apache.shiro.realm.text.TextConfigurationRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.Nameable;
import org.apache.shiro.util.PermissionUtils;
import org.apache.shiro.web.env.IniWebEnvironment;
import org.apache.shiro.web.util.WebUtils;
 
// TODO: Auto-generated Javadoc
/*
51,7 → 57,7
public class XServicesRealm extends IniRealm implements Nameable {
 
/** The logger. */
private static Logger logger = Logger.getLogger(XServicesRealm.class);
private final Logger logger = LogManager.getLogger();
/** The name. */
private String name;
70,11 → 76,25
* 'shiro.ini' in classpath and {@link net.brutex.xservices.security.PermissionResolver PermissionResolver}.
*
*/
public XServicesRealm() {
super();
this.setIni(Ini.fromResourcePath(ResourceUtils.CLASSPATH_PREFIX+"shiro.ini"));
/* needs review */
URI classesRootDir;
try {
classesRootDir = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
String dir = classesRootDir.toString().replaceAll("%20", " ");
dir = dir.substring(0, dir.lastIndexOf("WEB-INF"));
this.setIni(Ini.fromResourcePath(dir+"/WEB-INF/shiro.ini"));
} catch (URISyntaxException e) {
logger.error(e.getMessage(), e);
e.printStackTrace();
}
this.setPermissionResolver(new net.brutex.xservices.security.PermissionResolver());
//this.setRolePermissionResolver(new RolePermissionResolver());
init();
}
}
 
 
}
/xservices/trunk/src/java/net/brutex/xservices/security/XmlServicePermission.java
16,9 → 16,9
 
package net.brutex.xservices.security;
 
import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.shiro.authz.Permission;
import org.apache.shiro.util.AntPathMatcher;
 
/**
* @author Brian Rosenberger, bru(at)brutex.de
26,7 → 26,7
*/
public class XmlServicePermission implements Permission {
 
private final Logger logger = Logger.getLogger(XmlServicePermission.class);
private final Logger logger = LogManager.getLogger();
private final String permissionString;
 
public XmlServicePermission(String permissionString) {