Questions tagged [casbin]

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.

References

32 questions
0
votes
1 answer

Unable to Set up connection with Cloud SQL instance via casbin-sequelize-adapter

I am trying to connect my microservice with the CloudSQL instance via casbin-sequelize-adapter. Following is the code - await SequelizeAdapter.newAdapter({ username: process.env.DB_USER, password: process.env.DB_PASS, database:…
0
votes
0 answers

How do I convert AWS IAM policy into casbin policy?

I want to use the AWS IAM type policy and use casbin for authentication. How to convert the AWS IAM policy into a casbin policy ? Is there a sdk that can be used for conversion? The iam policy like this: { "Version": "2012-10-17", …
yzhengwei
  • 67
  • 2
  • 6
0
votes
0 answers

i want to say user b can not update mobile number in users table (field level access permissions)

I have RBAC Role Base Authorization (Casbin) i want to say some role can update user information, and also i have other role that can update users information but he/ she can not update for example users mobile number For example, a certain role can…
Ramin Azali
  • 198
  • 11
0
votes
0 answers

ExpressJS API Access Control

Im working on a personal project using the MERN stack (with MySql instead of Mongoose). For the backend I am attempting to setup the user permissions to have the level of access below but keep getting caught up on how to actually implement the…
Dunegans
  • 1
  • 1
0
votes
0 answers

Multiple casbin policy definitions in model fail when evaluated

I'm testing out a very simple permissions model, but seems like two policy_definition values in a model can not be handled in NodeJS? Is there another approach to the described model ? Model description: users belong to an organization,…
HIT_girl
  • 785
  • 7
  • 23
0
votes
1 answer

Load policies from string in casbin (golang)

can we load the policies directly form string in casbin similar to model I want similar for policies instead of loading from csv file text := ` [request_definition] r = sub, obj, act [policy_definition] p = sub, obj, act [role_definition] g = _,…
Akshay
  • 107
  • 2
  • 11
0
votes
2 answers

In Go gin framework , how to get all url that I have registered in the router

I’m programming the role based access control with casbin. However ,the police need me to provide urls that the role has. The “v1” column in the table, see the picture. I wondered can I get all urls that I registered in router. So that I don’t need…
陳鐘揚
  • 11
  • 1
0
votes
1 answer

Is it possible to match p.obj with role by pattern in casbin?

This is the model.conf I'm using: [request_definition] r = sub, obj, act [policy_definition] p = sub, obj, act, eft [role_definition] g = _, _ g2 = _, _ [policy_effect] e = some(where (p.eft == allow)) && !some(where (p.eft ==…
Si-Wei Yang
  • 321
  • 5
  • 11
0
votes
1 answer

CASBIN url subset block

I have following policies: p, alice, /alice_data/:id/using, GET p, bob, /alice_data/*, GET My current enforcer enforcement result: alice, /alice_data/hello, GET -> True bob, /alice_data/123/using, GET -> True I need to block bob for…
ratnesh
  • 436
  • 1
  • 5
  • 16
0
votes
1 answer

Custom function in casbin matcher in pycasbin for restful apis

Hi I want to check for roles single or multiple in the matcher for my restful apis endpoint, I am getting roles as list of strings, I want to enfore casbin permission for the endpoints. How do I create custom function in python, I am not getting any…
ratnesh
  • 436
  • 1
  • 5
  • 16
0
votes
0 answers

Handling resource authorization on RESTful API implemented with FastAPI

I'm building a small RESTful API using Python and FastAPI and I need to handle authorizations to some of the resources in this API (api.foo.co/things/restricted/, I want /restricted to be accessed only by some users/groups/something else). Is there…
Vladoski
  • 317
  • 2
  • 9
0
votes
0 answers

casbin nested resources (resource groups) config, not RBAC

I need to write a casbin config to implement user roles and nested resources (objects) in a node.js application. For users RBAC works well, propagating allowed rules from roles down to users. For resources (objects) I need a different policy: If obj…
Anton
  • 455
  • 6
  • 12
0
votes
1 answer

Casbin: user may only call path with their own username

I'm trying to implement Casbin authentication so that a user can only get their own username, but apply this to a group. Example: /users/get/alice can be called by user with username alice /users/get/john50 can be called by user with username…
Josh Laird
  • 6,974
  • 7
  • 38
  • 69
0
votes
1 answer

How to create Casbin model and policy for roles and resources that belongs to folders?

I'm trying to create a Casbin RBAC + ACL model. The business requirement is as follows: We have an Organization, and within Organization you can create Folders. There are special folders like Workspace folder. Basically, the folders are a way to…
JobaDiniz
  • 862
  • 1
  • 14
  • 32
0
votes
1 answer

How to use Node-Casbin in Angular?

Got a question regarding Node-Casbin library. I want to use this library in Angular, on the Front-end side. Unfortunately, I don't have a clue how could I do that. I want to use this library with strings. So I want to declare policies and data as a…
Restir
  • 129
  • 4
  • 12