|
@@ -0,0 +1,35 @@
|
|
|
+package com.lantone.security.aop;
|
|
|
+
|
|
|
+import com.lantone.dblayermbg.facade.ResourceFacade;
|
|
|
+import org.aspectj.lang.JoinPoint;
|
|
|
+import org.aspectj.lang.annotation.After;
|
|
|
+import org.aspectj.lang.annotation.Aspect;
|
|
|
+import org.aspectj.lang.annotation.Pointcut;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 资源与角色访问对应关系信息变更统一处理切面
|
|
|
+ * @author: rengb
|
|
|
+ * @time: 2021/8/26 10:43
|
|
|
+ */
|
|
|
+@Aspect
|
|
|
+@Component
|
|
|
+public class ResourceRoleRulesAspect {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResourceFacade resourceFacade;
|
|
|
+
|
|
|
+ @Pointcut("execution(public * com.lantone.security.web.RoleManagementController.addRole(..))" +
|
|
|
+ "||execution(public * com.lantone.security.web.RoleManagementController.deleteRole(..))" +
|
|
|
+ "||execution(public * com.lantone.security.web.RoleManagementController.disableRole(..))" +
|
|
|
+ "||execution(public * com.lantone.security.web.RoleManagementController.updateRole(..))")
|
|
|
+ public void basicInfoChange() {
|
|
|
+ }
|
|
|
+
|
|
|
+ @After("basicInfoChange()")
|
|
|
+ public void aspectAfter(JoinPoint joinPoint) throws Throwable {
|
|
|
+ resourceFacade.initResourceRolesMap();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|