command
module
Version:
v0.0.0-...-90e0d5a
Opens a new window with list of versions in this module.
Published: Jan 5, 2018
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
casbin-http-role-exampe
Simplistic Example of role-based HTTP Authorization with casbin using scs for session handling.
Run with
dep ensure
go run main.go
Which starts a server at http://localhost:8080
with the following routes:
POST /login
- accessible if not logged in
- takes
name
as a form-data parameter - there is no password
- Valid Users:
Admin
ID: 1
, Role: admin
Sabine
ID: 2
, Role: member
Sepp
ID: 3
, Role: member
POST /logout
- accessible if logged in
GET /member/current
- accessible if logged in as a member
GET /member/role
- accessible if logged in as a member
GET /admin/stuff
- accessible if logged in as an admin
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.