📄 webuser.java
字号:
package com.pegasus.framework.acl.pojo;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.pegasus.framework.acl.pojo.vo.User;
import com.pegasus.framework.action.BaseAction;
import com.pegasus.framework.castor.menu.WebMenu;
import com.pegasus.framework.web.WebMenuManager;
public class WebUser implements Serializable {
private Logger logger = LogManager.getLogger(BaseAction.class);
private User user;
// 用户操作特权,内部存放操作特权的代码,字符串
private Map userPrivilege = new HashMap();
// 用户敏感数据集特权,主键存放信息集的表名,值存放操作特权字符窜。
private Map userDataSetMap = new HashMap();
// 用户敏感数据项特权,主键存放信息集的表名,值存放一个Map对象,Map的key存放信息项的代码,值存放操作特权字符窜。
private Map userDataItemMap = new HashMap();
//用户的菜单
private WebMenu webMenu;
//用户可以有的子公司
private Long[] childCompany;
//用户当前服务的公司
private Long currentCompany;
//当前服务公司的名称
private String currentCompanyName;
/**
* @param user .
*/
public WebUser(User user) {
this.user = user;
}
/**
* @return .
*/
public User getUser() {
return user;
}
/**
* @param user .
*/
public void setUser(User user) {
this.user = user;
}
/**
* @return .
*/
public Set getUserPrivilege() {
return userPrivilege.keySet();
}
/**
* Map中的key为权限的代码
* value为权限对象类型是 Prvilege
*
* @return .
*/
public Map getUserPrivilegeMap() {
return userPrivilege;
}
/**
* Map中的key为权限的代码
* value为权限对象类型是 Prvilege
*
* @param userPrivilege .
*/
public void setUserPrivilege(Map userPrivilege) {
this.userPrivilege = userPrivilege;
}
/**
* Map中的key为数据集的代码
* value为权限对象类型是 DataSet
*
* @param code privilege code
* @return if can visit return true
*/
public boolean canVisit(String code) {
return userPrivilege.containsKey(code);
}
/**
* Map中的key为数据集的代码
* value为权限对象类型是 DataSet
*
* @return .
*/
public Map getUserDataItemMap() {
return userDataItemMap;
}
/**
* Map中的key为数据集的代码
* value为权限对象类型是 DataSet
*
* @param userDataItemMap .
*/
public void setUserDataItemMap(Map userDataItemMap) {
this.userDataItemMap = userDataItemMap;
}
/**
* @return .
*/
public Map getUserDataSetMap() {
return userDataSetMap;
}
/**
* @param userDataSetMap .
*/
public void setUserDataSetMap(Map userDataSetMap) {
this.userDataSetMap = userDataSetMap;
}
/**
* @param tableName .
* @return .
*/
public boolean canViewDataSet(String tableName) {
// TODO use OperationPrivilege;
return true;
}
/**
* @param tableName .
* @return .
*/
public boolean canAddDataSet(String tableName) {
// TODO use OperationPrivilege;
return true;
}
/**
* @param tableName .
* @return .
*/
public boolean canEditDataSet(String tableName) {
// TODO use OperationPrivilege;
return true;
}
/**
* @param tableName .
* @return .
*/
public boolean canRemoveDataSet(String tableName) {
// TODO use OperationPrivilege;
return true;
}
/**
* @return .
*/
public WebMenu getWebMenu() {
if (webMenu == null) {
webMenu = WebMenuManager.getUserWebMenu(this);
}
return webMenu;
}
/**
* @return currentCompany
*/
public Long getCurrentCompany() {
return currentCompany;
}
/**
* @param currentCompany currentCompany
*/
public void setCurrentCompany(Long currentCompany) {
this.currentCompany = currentCompany;
}
/**
* @return currentCompanyName
*/
public String getCurrentCompanyName() {
return currentCompanyName;
}
/**
* @param currentCompanyName currentCompanyName
*/
public void setCurrentCompanyName(String currentCompanyName) {
this.currentCompanyName = currentCompanyName;
}
/**
* @return .
*/
public Long[] getChildCompany() {
return childCompany;
}
/**
* @param childCompany .
*/
public void setChildCompany(Long[] childCompany) {
this.childCompany = childCompany;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -