gorm-adapter icon indicating copy to clipboard operation
gorm-adapter copied to clipboard

GORM adapter for Casbin, see extended version of GORM Adapter Ex at: https://github.com/casbin/gorm-adapter-ex

Results 13 gorm-adapter issues
Sort by recently updated
recently updated
newest added

Currently making an RBAC setup for a project. I am using the gorm filtered adapter to make sure that i will not have to implement it at another point due...

question

Fix: https://github.com/casbin/gorm-adapter/issues/175 support transaction Example: ```golang a := initAdapter(t, "mysql", "root:@tcp(127.0.0.1:3306)/", "casbin", "casbin_rule") e, _ := casbin.NewEnforcer("examples/rbac_model.conf", a) e.GetAdapter().(*Adapter).Transaction(e, func(e *casbin.Enforcer) error { _, err := e.AddPolicy("jack", "data1", "write") if...

We are currently modifying our codebase to instantiate a dbadapter per-request to our system, which is an HTTP web service, giving us control over the root database transaction as well...

question

When `Enforcer.UpdateFilteredPolicies()` is called, the calculation of effected lines require `old rules` returned by the Adapter in `sub, obj, act` form. However, the returned data is `p, sub, obj, act`....

bug

I've been meaning to implement soft delete on my `casbin_rule` table i.e have a `deactivated_at` column that is set to the time it the policy was deleted instead of completing...

question

I have used transaction like this ``` err := r.enforcer.GetAdapter().(*gormadapter.Adapter).Transaction(r.enforcer, func(i casbin.IEnforcer) error { allPolicies := i.GetFilteredPolicy(1, domainName) ok, err := i.RemovePolicies(allPolicies) if err != nil { return err }...

question

In the Transaction, there was an issue with the original code that checked if transactionMu was nil. Once entered, it couldn't exit. The problem was that Store(false) should have been...

https://github.com/casbin/gorm-adapter/blob/3d3a3c755df913a52c7077694c4b33f175a37894/adapter.go#L719-L725 https://github.com/casbin/gorm-adapter/blob/3d3a3c755df913a52c7077694c4b33f175a37894/adapter.go#L447-L464 https://github.com/casbin/gorm-adapter/blob/3d3a3c755df913a52c7077694c4b33f175a37894/adapter.go#L393-L401 Creating a tx without copying other key information causes truncate table to fail to find the table name。

question