|
@ -24,17 +24,18 @@ Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意
|
|
|
*/
|
|
|
package cn.stylefeng.guns.sys.core.aop;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.log.Log;
|
|
|
import cn.stylefeng.guns.core.annotion.BusinessLog;
|
|
|
import cn.stylefeng.guns.core.annotion.Permission;
|
|
|
import cn.stylefeng.guns.core.consts.AopSortConstant;
|
|
|
import cn.stylefeng.guns.core.consts.SymbolConstant;
|
|
|
import cn.stylefeng.guns.core.context.login.LoginContextHolder;
|
|
|
import cn.stylefeng.guns.core.enums.LogicTypeEnum;
|
|
|
import cn.stylefeng.guns.core.exception.PermissionException;
|
|
|
import cn.stylefeng.guns.core.exception.enums.PermissionExceptionEnum;
|
|
|
import cn.stylefeng.guns.core.util.HttpServletUtil;
|
|
|
import cn.stylefeng.guns.sys.core.log.LogManager;
|
|
|
import org.apache.tomcat.util.buf.StringUtils;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
@ -105,9 +106,9 @@ public class PermissionAop {
|
|
|
if (requireRoles.length != 0) {
|
|
|
boolean hasSpecialRolePermission = true;
|
|
|
if (LogicTypeEnum.AND.equals(logicTypeEnum)) {
|
|
|
hasSpecialRolePermission = LoginContextHolder.me().hasAllRole(StringUtils.join(requireRoles));
|
|
|
hasSpecialRolePermission = LoginContextHolder.me().hasAllRole(StrUtil.join(SymbolConstant.COMMA, (Object) requireRoles));
|
|
|
} else if (LogicTypeEnum.OR.equals(logicTypeEnum)) {
|
|
|
hasSpecialRolePermission = LoginContextHolder.me().hasAnyRole(StringUtils.join(requireRoles));
|
|
|
hasSpecialRolePermission = LoginContextHolder.me().hasAnyRole(StrUtil.join(SymbolConstant.COMMA, (Object) requireRoles));
|
|
|
} else {
|
|
|
log.error(">>> permission注解逻辑枚举错误");
|
|
|
}
|