This document presents an example of dynamic permission menu loading based on jCasbin. Through jCasbin, you can easily manage menu permissions in Spring Boot development.
Technology Stack
- Backend: Spring Boot 2.x + jCasbin + Spring Data JPA
- Frontend: Tailwind CSS + Thymeleaf
Startup Instructions
- Build the menu structure you need in the
casbin/policy.csv
file. Specifically,g2
represents the relationship between menus. For example:g2, submenu name, parent menu name
. - Once the configuration is complete, run the
main
method inApplication.java
located underorg/casbin/
. Accesshttp://localhost:8080/
for testing. - The access control model file for jCasbin is located at
casbin/model.conf
, and the policy file is atcasbin/policy.csv
. Modify them as needed based on your requirements.
Demonstration video
Root user
Admin user
Normal user