Example for casbin-spring-boot-starter

Clone this repo:

Branches

  1. 496db29 feat: migrate from Gradle to Maven (#4) by Bond · 1 year, 2 months ago master
  2. 7e522b3 Improve docs by hsluoyz · 2 years, 4 months ago
  3. e2eba1e feat: add casbin springboot starter example (#2) by Taoning Ge · 3 years, 7 months ago
  4. d3229a6 Initial commit by Yang Luo · 3 years, 7 months ago

casbin-spring-boot-example

A simple example of casbin-spring-boot-starter.

Requirement

JDK 17+

Usage

The project will start a server by default at http://localhost:8080 with following api:

  • GET /auth/login: login to system.

    Request params:

    • username: admin or user
    • password: pwd

    Example: GET /auth/login?username=admin&password=pwd

  • GET /auth/logout: logout the system.

  • GET /data/admins/all: available when login with admin account.

  • PUT /data/admins/state/{state}: Change the protected data, available when login with admin/user account.

  • GET /data/users/all: available when login with admin/user account.

Special thanks to https://github.com/jveverka/spring-examples/tree/java-17/spring-jcasbin