Closed shreyasGit closed 3 years ago
@shy1st plz take a look.
@shreyasGit fixed and released: https://github.com/casbin/jcasbin/releases/tag/v1.6.4
this is not fixednow i get following error Exception in thread "main" java.lang.ClassCastException: org.casbin.adapter.JdbcAdapter cannot be cast to org.casbin.jcasbin.persist.file_adapter.FilteredAdapter at org.casbin.jcasbin.main.CoreEnforcer.loadFilteredPolicy(CoreEnforcer.java:241) at com.sas.mkt.example.controller.DumpDataUtil.main(DumpDataUtil.java:58)
if (adapter instanceof org.casbin.jcasbin.persist.FilteredAdapter) {
filteredAdapter = (FilteredAdapter) adapter;
the cast is not needed
@shreyasGit Would you mind show me your code of how you create the JdbcAdapter?
ping @shreyasGit
@shreyasGit @shy1st I think I found the cause.
The latest version of casbin-spring-boot-starter was released 15 days ago: https://github.com/jcasbin/casbin-spring-boot-starter/releases/tag/0.0.11
However, latest jCasbin was released 10 days ago: https://github.com/casbin/jcasbin/releases/tag/v1.6.4
So we need to update casbin-spring-boot-starter's POM dependency to use jCasbin v1.6.4. @shy1st can you make a PR for it?
@hsluoyz yes,I can.
@shreyasGit @shy1st I think I found the cause.
The latest version of casbin-spring-boot-starter was released 15 days ago: https://github.com/jcasbin/casbin-spring-boot-starter/releases/tag/0.0.11
However, latest jCasbin was released 10 days ago: https://github.com/casbin/jcasbin/releases/tag/v1.6.4
So we need to update casbin-spring-boot-starter's POM dependency to use jCasbin v1.6.4. @shy1st can you make a PR for it?
@hsluoyz Please see: https://github.com/jcasbin/casbin-spring-boot-starter/pull/26
@shy1st merged, plz make a new release of https://github.com/jcasbin/casbin-spring-boot-starter
@shreyasGit can you see if v0.0.12 fixed this issue? https://github.com/jcasbin/casbin-spring-boot-starter/releases/tag/0.0.12
The v0.0.12 of the casbin-spring-boot-starter had released in the maven repository.
@shreyasGit fixed in: https://github.com/casbin/jcasbin/pull/153
i think theres an issue in Jcasbin java version 1.6.3 and older , it does not support filtering on jdbc adapter, when i try to use https://github.com/jcasbin/casbin-spring-boot-starter with jcasbin, i see that in CoreEnforcer , it expects FilterAdapter only from file_adapter package, else throws this eroor.in short cannot use any jdbc adapter with Jcasbin
in above code FilteredAdapter should be referenced from org.casbin.jcasbin.persist package which is a parent interface. Due to this when i try to use any jdbcadapter to filter policies i get an error "Filtered policies are not supported by this adapter."