新增角色权限权限可见性,字典状态限制。

This commit is contained in:
RuoYi 2019-04-07 22:16:17 +08:00
parent f48b9ff9b9
commit 99e85093e1
3 changed files with 29 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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">