Comments (11)
@techoner @Nekotoxin
from pycasbin.
Screenshot error, re-attach the picture
from pycasbin.
It seems that you are using asynccasbin, which is not official maintained. In pycasbin, I tried with the following code and the behavior is correct. Since I don't know how you write your model, I just used this model.
Also, we are considering add official support for async in the following weeks. You can follow our latest updates.
from pycasbin.
@moreKing if you are using this 3rd-party async lib: https://github.com/chapagainmanoj/asynccasbin , please note that lib is not maintained by Casbin. You should create an issue at that repo
from pycasbin.
asynccasbin is indeed no longer maintained and has closed all interaction channels
The official asynchronous repository has been created for a year, but nothing has happened: https://github.com/casbin/async-pycasbin
Very much looking forward to any development of it as there are still quite a few users who like casbin
Why use asynchrony? Asynchronous is gaining popularity due to FastAPI, and you can imagine how bad it would be to integrate a synchronous license into an asynchronous project, even though there is already asynccasbin, which, as mentioned above, is no longer maintained, and even though there are already a number of asynchronous storage tools, they are all based on asynccasbin, which will always have limitations.
In my projects fastapi-practices, casbin has always been preferred for permissions, but due to some issues with the asynchronous storage, I had to temporarily replace it with a custom permission,But their implementation has remained in the code
As you can tell by asynccasbin, the asynchronous version is perfectly viable, hopefully there will be some official action here, hard work guys!
I'm willing to actively do the testing
from pycasbin.
asynccasbin is indeed no longer maintained and has closed all interaction channels
The official asynchronous repository has been created for a year, but nothing has happened: https://github.com/casbin/async-pycasbin
Very much looking forward to any development of it as there are still quite a few users who like casbin
Why use asynchrony? Asynchronous is gaining popularity due to FastAPI, and you can imagine how bad it would be to integrate a synchronous license into an asynchronous project, even though there is already asynccasbin, which, as mentioned above, is no longer maintained, and even though there are already a number of asynchronous storage tools, they are all based on asynccasbin, which will always have limitations.
In my projects fastapi-practices, casbin has always been preferred for permissions, but due to some issues with the asynchronous storage, I had to temporarily replace it with a custom permission,But their implementation has remained in the code
As you can tell by asynccasbin, the asynchronous version is perfectly viable, hopefully there will be some official action here, hard work guys!
I'm willing to actively do the testing
We're working on it this summer.
from pycasbin.
thank every one of you, I use the library is according to the official website document to install casbin, the use of orm is tortoise-orm[asyncpg], the adapter is written by me, my current practice is to batch delete all eligible, and then batch add
from pycasbin.
thank every one of you, I use the library is according to the official website document to install casbin, the use of orm is tortoise-orm[asyncpg], the adapter is written by me, my current practice is to batch delete all eligible, and then batch add
@moreKing If you use the official casbin, it shouldn't have this problem, can you show your model
?
from pycasbin.
I'm not sure what I did wrong, so I took a screenshot of all the relevant code. I only implemented load_policy and save_policy two methods for the adapter, and the contents of other methods were pass,which I did not want to save automatically. I stored the model in a variable, and did not use file saving to minimize external dependencies
from pycasbin.
@moreKing Please try the existing policies in the database?
add_policies
execution will terminate if it encounters an existing policy.
from pycasbin.
Closed as resolved
from pycasbin.
Related Issues (20)
- Typo in synced enforcer ? HOT 2
- Casbin not able to load data from mysql , It's work on 1.15 version but not working on 1.17 HOT 10
- Improve policies reload time HOT 1
- Invallid policy size when checking if value is in array HOT 5
- Add batchEnforce() API for pycasbin HOT 2
- README.md file in package is installed in venv outside the package subdirectory HOT 3
- Performance issue when casbin_rule table has 86k rows HOT 2
- Bug in priority effectors HOT 14
- Enforcer doesn't respect enable_log HOT 2
- casbin disable all logger HOT 1
- Policies with explicit integer priorities are not sorted correctly HOT 1
- Unexpected logging behaviour when enable_log is False by default HOT 4
- Missing "]" symbol on line 4 of /example/error/error_model.conf HOT 2
- asyncio Adapter support HOT 4
- 10k+ rule using ABAC takes about 500ms HOT 2
- Failed to initialize Enforcer string model HOT 3
- Asynchronous adapters interface stubs do not match when pycasbin > = 1.34.0 HOT 6
- Python 3.11 support HOT 3
- AsyncEnforcer doesn't support async calls for Watcher's update function HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycasbin.