use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class ShiroServiceImpl method check.
@Override
public boolean check(Object[] permissions) {
SysUser user = ShiroHelper.getPrincipal();
if (user == null) {
return false;
}
String join = StringUtils.join(permissions, ShiroHelper.NAMES_DELIMETER);
if (ShiroHelper.hasAnyRole(join)) {
return true;
}
return false;
}
use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class ShiroServiceImpl method checkAll.
@Override
public boolean checkAll() {
SysUser user = ShiroHelper.getPrincipal();
if (user == null) {
return false;
}
String requestURI = ShiroHelper.getAccessAddress(WebUtilHelper.getHttpServletRequest());
if (ShiroHelper.hasPermission(requestURI)) {
return true;
}
return false;
}
use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class ManagerUserServiceImpl method delete.
/**
* 删除用户
*/
@Override
@Transactional(readOnly = false)
public Integer delete(Object record) throws Exception {
SysUser sysUser = new SysUser();
sysUser.setId((Integer) record);
sysUser.setIfEnabled(0);
return baseDao.update(PREFIX + "updateByPrimaryKey", sysUser);
}
use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class ManagerUserServiceImpl method checkUserExits.
/**
* 检查用户是否存在
*/
@Override
@Transactional(readOnly = true)
public SysUser checkUserExits(String userName, String passWord) throws Exception {
SysUser managerUser = new SysUser();
managerUser.setUserName(userName);
managerUser.setPassword(passWord);
return checkUserExits(managerUser);
}
use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class LoginController method kickout.
/**
* @方法:用户被提出\被挤掉
* @创建人:独泪了无痕
* @return
*/
@RequestMapping(params = "kickout")
public String kickout(HttpServletRequest request) {
SysUser currenLoginUser = ShiroHelper.getPrincipal();
// 判断用户是否为空,不为空,则清空session中的用户object
if (currenLoginUser != null) {
HttpSession session = request.getSession();
session.removeAttribute(GlobalConstants.USER_SESSION);
ShiroHelper.logout();
}
return FilterHelper.LOGIN_SHORT;
}
Aggregations