📄 xmlaclhandler.java
字号:
package com.exp.fcl.security.aclimp;
import java.util.Vector;
import com.exp.fcl.security.UserLogin;
import com.exp.fcl.xml.EXPXMLNode;
public class XMLACLHandler {
protected EXPXMLNode aclConfigNode;
protected ACLControl control;
public XMLACLHandler(EXPXMLNode resConfig, UserLogin login) {
this(login);
this.aclConfigNode = resConfig;
}
public XMLACLHandler(UserLogin login) {
this.control = new ACLControl(login);
}
public void setACLConfigNode(EXPXMLNode config) {
this.aclConfigNode = config;
}
public String[] getAccepts(XMLACLFilter filter) {
return this.getControls(true, filter);
}
public String[] getRejects(XMLACLFilter filter) {
return this.getControls(false, filter);
}
protected String[] getControls(boolean bAccepted, XMLACLFilter filter) {
if (this.aclConfigNode != null) {
int count = this.aclConfigNode.getChildNodesCount();
Vector rets = new Vector();
for (int i = 0; i < count; i++) {
EXPXMLNode configNode = this.aclConfigNode.getChildNode(i);
String aclString = configNode.getAttributeValue("acl");
String rclString = configNode.getAttributeValue("rcl");
if (control.canAccess(aclString, rclString) == bAccepted) {
rets.add(configNode.getNodeName());
if (filter != null) {
filter.doFilter(configNode);
}
}
}
return (String[]) rets.toArray(new String[rets.size()]);
} else {
return new String[] {};
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -