All Projects → casbin → Beego Authz

casbin / Beego Authz

Licence: apache-2.0
Beego's RBAC & ABAC Authorization middleware based on Casbin

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Beego Authz

Mongodb Adapter
MongoDB adapter for Casbin
Stars: ✭ 194 (-6.73%)
Mutual labels:  authorization, access-control, casbin
Casbin Cpp
An authorization library that supports access control models like ACL, RBAC, ABAC in C/C++
Stars: ✭ 113 (-45.67%)
Mutual labels:  authorization, access-control, casbin
Openstack Policy Editor
A Casbin Policy Editor for OpenStack
Stars: ✭ 28 (-86.54%)
Mutual labels:  authorization, access-control, casbin
Protobuf Adapter
Google Protocol Buffers adapter for Casbin
Stars: ✭ 185 (-11.06%)
Mutual labels:  authorization, access-control, casbin
Redis Adapter
Redis adapter for Casbin
Stars: ✭ 167 (-19.71%)
Mutual labels:  authorization, access-control, casbin
Node Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser
Stars: ✭ 1,757 (+744.71%)
Mutual labels:  authorization, access-control, casbin
Negroni Authz
negroni-authz is an authorization middleware for Negroni
Stars: ✭ 152 (-26.92%)
Mutual labels:  authorization, access-control, casbin
Gorm Adapter
Gorm adapter for Casbin
Stars: ✭ 373 (+79.33%)
Mutual labels:  authorization, access-control, casbin
Etcd Watcher
Etcd watcher for Casbin
Stars: ✭ 157 (-24.52%)
Mutual labels:  authorization, access-control, casbin
Jcasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Java
Stars: ✭ 1,335 (+541.83%)
Mutual labels:  authorization, access-control, casbin
Pycasbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Python
Stars: ✭ 625 (+200.48%)
Mutual labels:  authorization, access-control, casbin
Casbin Server
Casbin as a Service (CaaS)
Stars: ✭ 171 (-17.79%)
Mutual labels:  authorization, access-control, casbin
Casbin.net
An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
Stars: ✭ 535 (+157.21%)
Mutual labels:  authorization, access-control, casbin
Laravel Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Stars: ✭ 136 (-34.62%)
Mutual labels:  authorization, access-control, casbin
Casbin Rs
An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
Stars: ✭ 375 (+80.29%)
Mutual labels:  authorization, access-control, casbin
Casbin Editor
Web-based model & policy editor for Casbin
Stars: ✭ 45 (-78.37%)
Mutual labels:  authorization, access-control, casbin
sequelize-adapter
Sequelize adapter for Casbin
Stars: ✭ 51 (-75.48%)
Mutual labels:  authorization, access-control, casbin
Xorm Adapter
Xorm adapter for Casbin
Stars: ✭ 329 (+58.17%)
Mutual labels:  authorization, access-control, casbin
Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
Stars: ✭ 10,872 (+5126.92%)
Mutual labels:  authorization, access-control, casbin
Think Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in ThinkPHP 6.0 .
Stars: ✭ 155 (-25.48%)
Mutual labels:  authorization, access-control, casbin

beego-authz Build Status Coverage Status GoDoc

beego-authz is an authorization middleware for Beego. It provides authorization like ACL, RBAC, ABAC based on Casbin: https://github.com/casbin/casbin

With beego-authz, you can control who can access what resource via which method for your Beego app.

Get Started

Step 1: edit the policy

Modify the Casbin model: authz_model.conf and policy: authz_policy.csv as you want. You may need to learn Casbin's basics to know how to edit these files. The policy means that the user alice can access /dataset1/* via GET and /dataset1/resource1 via POST. The similar way applies to user bob. cathy has the role dataset1_admin, which is permitted to access any resources under /dataset1/ with any action. For more advanced usage of Casbin (like database support, policy language grammar, etc), please refer to Casbin: https://github.com/casbin/casbin

Step 2: integrate with Beego

Insert the Casbin authorizer as a Beego filter.

beego.InsertFilter("*", beego.BeforeRouter, authz.NewAuthorizer(casbin.NewEnforcer("authz_model.conf", "authz_policy.csv")))

Step 3: setup with authentication

Make sure you already have an authentication mechanism, so you know who is accessing, like a username. Modify the GetUserName() method to let Casbin know the current authenticated username.

Getting Help

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].