新增角色权限权限可见性,字典状态限制。
parent
f48b9ff9b9
commit
99e85093e1
|
@ -41,12 +41,12 @@ public class LogAspect
|
|||
}
|
||||
|
||||
/**
|
||||
* 前置通知 用于拦截操作
|
||||
* 处理完请求后执行
|
||||
*
|
||||
* @param joinPoint 切点
|
||||
*/
|
||||
@AfterReturning(pointcut = "logPointCut()")
|
||||
public void doBefore(JoinPoint joinPoint)
|
||||
public void doAfterReturning(JoinPoint joinPoint)
|
||||
{
|
||||
handleLog(joinPoint, null);
|
||||
}
|
||||
|
@ -54,11 +54,11 @@ public class LogAspect
|
|||
/**
|
||||
* 拦截异常操作
|
||||
*
|
||||
* @param joinPoint
|
||||
* @param e
|
||||
* @param joinPoint 切点
|
||||
* @param e 异常
|
||||
*/
|
||||
@AfterThrowing(value = "logPointCut()", throwing = "e")
|
||||
public void doAfter(JoinPoint joinPoint, Exception e)
|
||||
public void doAfterThrowing(JoinPoint joinPoint, Exception e)
|
||||
{
|
||||
handleLog(joinPoint, e);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,31 @@ public class PermissionService
|
|||
return isPermittedOperator(permission) ? "" : "hidden";
|
||||
}
|
||||
|
||||
public String hasRole(String role)
|
||||
{
|
||||
return hasRoleOperator(role) ? "" : "hidden";
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否拥有某个权限
|
||||
*
|
||||
* @param permission 权限字符串
|
||||
* @return 结果
|
||||
*/
|
||||
private boolean isPermittedOperator(String permission)
|
||||
{
|
||||
return SecurityUtils.getSubject().isPermitted(permission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否拥有某个角色
|
||||
*
|
||||
* @param role 角色字符串
|
||||
* @return 结果
|
||||
*/
|
||||
private boolean hasRoleOperator(String role)
|
||||
{
|
||||
return SecurityUtils.getSubject().hasRole(role);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_type = #{dictType} order by dict_sort asc
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
|
|
Loading…
Reference in New Issue