Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Beangle, Agile Development Scaffold and Toolkit
*
* Copyright (c) 2005-2016, Beangle Software.
*
* Beangle is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Beangle is distributed in the hope that it will be useful.
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Beangle. If not, see .
*/
package org.beangle.ems.security.web.action;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.beangle.commons.collection.CollectUtils;
import org.beangle.commons.collection.Order;
import org.beangle.commons.dao.Operation;
import org.beangle.commons.dao.query.builder.Condition;
import org.beangle.commons.dao.query.builder.OqlBuilder;
import org.beangle.commons.entity.Entity;
import org.beangle.commons.lang.Strings;
import org.beangle.commons.transfer.exporter.PropertyExtractor;
import org.beangle.ems.security.helper.UserDashboardHelper;
import org.beangle.ems.security.helper.UserPropertyExtractor;
import org.beangle.ems.web.action.SecurityActionSupport;
import org.beangle.security.blueprint.Role;
import org.beangle.security.blueprint.RoleMember;
import org.beangle.security.blueprint.Settings;
import org.beangle.security.blueprint.User;
import org.beangle.security.blueprint.model.RoleMemberBean;
import org.beangle.security.blueprint.model.UserBean;
import org.beangle.security.codec.EncryptUtil;
import org.beangle.struts2.convention.route.Action;
/**
* 用户管理响应处理类
*
* @author chaostone 2005-9-29
*/
public class UserAction extends SecurityActionSupport {
private UserDashboardHelper userDashboardHelper;
public String dashboard() {
Long userId = getLongId("user");
User managed = null;
if (null != userId) {
managed = entityDao.get(User.class, userId);
} else {
String username = get("user.name");
if (null != username) managed = securityHelper.getUserService().get(username);
}
User me = entityDao.get(User.class, getUserId());
if (null != managed) {
if (me.equals(managed) || securityHelper.getUserService().isManagedBy(me, managed)) {
userDashboardHelper.buildDashboard(managed);
return forward();
} else {
return forward(ERROR);
}
} else {
userDashboardHelper.buildDashboard(me);
}
return forward();
}
@SuppressWarnings("unchecked")
protected OqlBuilder getQueryBuilder() {
User manager = entityDao.get(User.class, getUserId());
OqlBuilder userQuery = OqlBuilder.from(getEntityName(), "user");
// 查询角色
StringBuilder sb = new StringBuilder("exists(from user.members m where ");
List