Browse Source

修改权限逻辑

my-csc-config-file.git 3 years ago
parent
commit
3d76c91657

+ 4 - 1
src/main/java/com/unissoft/config/MySecurityMetadataSource.java

@@ -49,7 +49,10 @@ public class MySecurityMetadataSource implements FilterInvocationSecurityMetadat
49
                     configAttributes2.add(securityConfig);
49
                     configAttributes2.add(securityConfig);
50
                     linkedHashMap.put(urlPattern1, configAttributes2);
50
                     linkedHashMap.put(urlPattern1, configAttributes2);
51
                 } else {
51
                 } else {
52
-                    linkedHashMap.get(urlPattern1).add(securityConfig);
52
+                    Collection<ConfigAttribute> configAttributes = linkedHashMap.get(urlPattern1);
53
+                    if(!configAttributes.contains(securityConfig)){
54
+                        configAttributes.add(securityConfig);
55
+                    }
53
                 }
56
                 }
54
             }
57
             }
55
         }
58
         }

+ 2 - 1
src/main/java/com/unissoft/mapper/SysResourceRoleMapper.xml

@@ -32,8 +32,9 @@ FROM
32
 	sys_resource t1
32
 	sys_resource t1
33
 LEFT JOIN project t2 ON t1.`se_project_id` = t2.`id`
33
 LEFT JOIN project t2 ON t1.`se_project_id` = t2.`id`
34
 LEFT JOIN sys_resource_role t3 ON t1.`se_id` = t3.`resource_id`
34
 LEFT JOIN sys_resource_role t3 ON t1.`se_id` = t3.`resource_id`
35
+LEFT JOIN sys_role r ON t3.role_id = r.r_id
35
 WHERE
36
 WHERE
36
 	t2.`code` = #{projectCode}
37
 	t2.`code` = #{projectCode}
37
-AND t1.se_button != '' AND t1.se_button IS NOT NULL
38
+AND t1.se_button != '' AND t1.se_button IS NOT NULL AND t1.se_button != '/'
38
     </select>
39
     </select>
39
 </mapper>
40
 </mapper>