Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcasbin/jcasbin-menu-permission
Casbin Menu Permission Example (Based on jCasbin)
https://github.com/jcasbin/jcasbin-menu-permission
abac acl auth authorization authz casbin data go java jcasbin menu permission rbac spring springboot
Last synced: 2 months ago
JSON representation
Casbin Menu Permission Example (Based on jCasbin)
- Host: GitHub
- URL: https://github.com/jcasbin/jcasbin-menu-permission
- Owner: jcasbin
- License: apache-2.0
- Created: 2024-01-15T13:32:20.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-24T08:16:54.000Z (10 months ago)
- Last Synced: 2024-03-24T09:23:56.227Z (10 months ago)
- Topics: abac, acl, auth, authorization, authz, casbin, data, go, java, jcasbin, menu, permission, rbac, spring, springboot
- Language: Java
- Homepage: https://github.com/casbin/jcasbin
- Size: 18.6 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jcasbin-menu-permission
## Introduction
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.## Project Overview
**Technology Stack**
- **Backend:** Spring Boot 2.x + jCasbin + Spring Data JPA
- **Frontend:** Tailwind CSS + Thymeleaf**Startup Instructions**
1. Build the menu structure you need in the [`casbin/policy.csv`](https://github.com/jcasbin/jcasbin-menu-permission/blob/master/src/main/resources/casbin/policy.csv) file. Specifically, `g2` represents the relationship between menus. For example: `g2, submenu name, parent menu name`.
2. Once the configuration is complete, run the `main` method in [`Application.java`](https://github.com/jcasbin/jcasbin-menu-permission/blob/master/src/main/java/org/casbin/Application.java) located under `org/casbin/`. Access `http://localhost:8080/` for testing.
3. The access control model file for jCasbin is located at [`casbin/model.conf`](https://github.com/jcasbin/jcasbin-menu-permission/blob/master/src/main/resources/casbin/model.conf), and the policy file is at [`casbin/policy.csv`](https://github.com/jcasbin/jcasbin-menu-permission/blob/master/src/main/resources/casbin/policy.csv). Modify them as needed based on your requirements.## Simple Examples
**Demonstration video**
**Root user**
**Admin user**
**Normal user**