casbin is an open-source access control library. It provides support for enforcing authorization based on various access control models such as ACLs, RBAC and ABAC. The core implementation of casbin is programmed in Go, but there are ports in mutilple languages: Python, PHP, Node, .Net and Java.
Questions tagged [casbin]
32 questions
3
votes
0 answers
Casbin ABAC on large number of resources/objects
I have a simple rest application written in golang where I have 2 entities: orders and users and I am trying to solve the authorization part using casbin. I have really low experience in writing this kind of authorizations so I will try to be clear…

bernadd
- 660
- 1
- 10
- 19
2
votes
0 answers
Enforce Casbin policy into SQL WHERE
I have trouble implementing ABAC with Postgresql. My plan is to use Cabsin but I can't figure out how translate Cabsin security clauses into SQL WHERE predicates.

msu
- 21
- 1
1
vote
0 answers
Compine RBAC with ABAC casbin
I am quite new programmer and I need your help. I need to combine RBAC with ABAC. For the application requirements, imagine that we have some endpoints that some users with a specific role have access tos (imagine only the admin can POST an action…
1
vote
0 answers
Evaluate Casbin policies real-time
I use Casbin as authorization library for my REST API, written in Go.
To load the policy from my Mongo database, I use MongoDB Adapter.
A single policy Mongo document looks like this:
{
"_id": {
"$oid": "639491f73e4c9bec05a1d1ec"
},
…

studio-pj
- 689
- 6
- 19
1
vote
1 answer
Casbin: Retrieve all objects for subject with particular action. RBAC use case
I need to implement custom RBAC support for my product and I stumbled upon casbin/jcasbin that looks promising.
I am checking java API and I do not seem to find a way to fetch all objects of a particular type that a user has access to.
Say, I am…

Ihor M.
- 2,728
- 3
- 44
- 70
1
vote
1 answer
missing generics for trait `actix_service::Service` --> src/middleware.rs:57:8
How do I implement traits? On running cargo build I get this error.
Also I commented out type Request = ServiceRequest;. How would this affect the code? I updated actix-service to 2.0.0-beta.2 in Cargo.toml, then the build failed.
error[E0107]:…

eth_sign
- 63
- 7
1
vote
0 answers
crate casbin policy for specific need
Is it possible to have policy which grant read read access to all resource except for specific one.
My current policy is:
p, read_some, data1, read
p, read_all, data2, read
p, read_all, data3, read
g, read_all, read_some
Is it possible to…

jason135
- 179
- 1
- 3
- 18
1
vote
0 answers
How to secure resources with Casbin based on multiple groups membership
What is the best option to implement such security in Casbin?
I have several folders, each of them has its own security (i.e. the users allowed to accede it)
But that's not enough, the action a user is allowed to performed in a folder depends on…

Julien
- 77
- 4
1
vote
2 answers
how to set casbin conf if I want to use rabc with resource roles at the same time match the restful api
I use the casbin with rabc with resource model, this is my conf:
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
g2 = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m =…

M.Mike
- 663
- 1
- 6
- 12
1
vote
1 answer
Error: filtered policies are not supported by this adapter
This TypeORMAdapter (https://github.com/node-casbin/typeorm-adapter) supports FilteredAdapter however not sure why I'm getting below error : -
Error: filtered policies are not supported by this adapter
message:"filtered policies are not supported by…

vinod827
- 1,123
- 1
- 21
- 45
1
vote
1 answer
What best practices or access control models are recommended for implementing fine-grained access control
We are currently building a webapp, which has several user roles. Each user has one or more roles assigned, which grants them permission to interact with specific parts (REST resources) of the webapp. For example, a user with role admin is allowed…

Peter Verschuure
- 15
- 6
1
vote
0 answers
how casbin can be used for abac with large user base
I am trying to use casbin for my project ABAC and RBAC
I am stuck in understanding this marchers
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft ==…

scoder
- 2,451
- 4
- 30
- 70
1
vote
0 answers
ES 2015 Import all using asterisk
I'm implementing node-casbin in my project. I tried importing everything into my project using the code below.
import * as casbin from 'casbin';
When I save my Node.js server crashes with the error below.
import * as casbin from 'casbin';
…

CloudBranch
- 1,434
- 3
- 18
- 23
1
vote
1 answer
How to use Casbin to setup dynamic RBAC with Beego?
How do I setup dynamic RBAC using Casbin with Beego?
I am using MySQL database via Beego ORM and able to login. However, I want to setup roles and permissions.
I also explored gorbac but I am interested to use Casbin.

Prashant
- 2,005
- 3
- 17
- 24
0
votes
1 answer
How can I link a collection of users to policy rules of a single resource using Casbin RBAC?
Unable to come up with appropriate RBAC model for linking collection of users to policy rules of a single resource.
[request_definition]
r = resource_id, module, action
[policy_definition]
p = priority, resource_id, module, action,…

Raj Saha
- 49
- 1
- 7