You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@casbin.apache.org by "AEnjoy (via GitHub)" <gi...@apache.org> on 2026/05/21 10:05:11 UTC
[I] The current version of the adapter is incompatible with Casbin v3. [casbin-pg-adapter]
AEnjoy opened a new issue, #57:
URL: https://github.com/apache/casbin-pg-adapter/issues/57
```go
import(
pgadapter "github.com/casbin/casbin-pg-adapter"
"github.com/casbin/casbin/v3"
)
func Enforcer(){
a, err := pgadapter.NewAdapter(dbDSN)
if err != nil {
return nil, fmt.Errorf("casbin postgres adapter: %w", err)
}
adapter = a
e, err := casbin.NewEnforcer(cfg.ModelPath, adapter)
if err != nil {
return nil, fmt.Errorf("casbin new enforcer: %w", err)
}
// .....
}
```
it will throw panic:
```
panic: interface conversion: *pgadapter.Adapter is not persist.Adapter: missing method LoadPolicy
goroutine 1 [running]:
github.com/casbin/casbin/v3.NewEnforcer({0x3e2661c87558, 0x2, 0x0?})
/home/lyc/go/pkg/mod/github.com/casbin/casbin/v3@v3.10.0/enforcer.go:102 +0x3d9
paas/internal/iam/infrastructure/casbin.NewEnforcer({{0x3e2661c20b00, 0x19}, {0x3e2661a8c460, 0x8}, 0x1, 0x1, {0x3e26613d2630, 0x16}, {0x3e26613d2648, 0x17}, ...}, ...)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org
Re: [I] [BUG] The current version of the adapter is incompatible with Casbin v3. [casbin-pg-adapter]
Posted by "hsluoyz (via GitHub)" <gi...@apache.org>.
hsluoyz closed issue #57: [BUG] The current version of the adapter is incompatible with Casbin v3.
URL: https://github.com/apache/casbin-pg-adapter/issues/57
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org
Re: [I] [BUG] The current version of the adapter is incompatible with Casbin v3. [casbin-pg-adapter]
Posted by "AEnjoy (via GitHub)" <gi...@apache.org>.
AEnjoy commented on issue #57:
URL: https://github.com/apache/casbin-pg-adapter/issues/57#issuecomment-4507044981
go.mod:
```
github.com/casbin/casbin-pg-adapter v1.5.0
github.com/casbin/casbin/v3 v3.10.0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org
Re: [I] [BUG] The current version of the adapter is incompatible with Casbin v3. [casbin-pg-adapter]
Posted by "hsluoyz (via GitHub)" <gi...@apache.org>.
hsluoyz commented on issue #57:
URL: https://github.com/apache/casbin-pg-adapter/issues/57#issuecomment-4518762331
@AEnjoy fixed in: https://github.com/apache/casbin-pg-adapter/commit/a36c3c164a905aeb02dae343143c48b327683309
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org