Database transactions similar api `addPolicies`, `removePolicies`
See original GitHub issueHello, recently I’m having another issue, while creating a new user/role, I would like to assign some default rights for it.
We can definitly call multiple times addPolicy
but it cannot guarantee that all the default policies have been added, I’m risking having an invalid user
in that case.
So I’m thinking if we could have some wrappers like addPolicies
, removePolicies
.
addPolicies
returns Promise<true>
only if all the policies have been added, if one of them fails then it cancels this operation (remove the ones have been added)
removePolicies
is similar.
Issue Analytics
- State:
- Created 4 years ago
- Comments:34 (34 by maintainers)
Top Results From Across the Web
Adapters - Casbin
Cassandra Adapter, NoSQL, Casbin, ❌, For Apache Cassandra DB ... rules cannot be automatically saved back to the storage when you add or...
Read more >Database Transactions - Drupal APIs
This is done in Drupal using database transactions. A transaction is started, database writes are made, and if any errors should arise, ...
Read more >Using Atomic Transactions to Power an Idempotent API
A data race causing two concurrent HTTP requests to insert the same row. Luckily, in this example we've used an even more powerful...
Read more >How to replicate database transactions in OData environment?
When you interact with IFS using PL/SQL API, you normally open database transactions. You modify and add new records to different tables, ...
Read more >Transactions and optimistic concurrency control
Traditional relational databases, like SQL Server, allow you to write the business logic using stored-procedures and/or triggers, send it to the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Sefriol Sounds good, but importing it will complicate Casbin.
In
casbin-golang
, while callingaddPolicies
in model:we call
hasPolicy
to avoid duplicated policies, if one policy already exist, then we cancel the whole operation.It looks similar to
casbin-rs
.TODO in
casbin-golang