How to use cache permissions in grails siro

every time i call subject.isPermited (), it sends sql to db. how can i cache it?

any example? thank


I read the shiro grail plugin document. but can not solove it.

DataSource:

hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}

then how to set the cache manager on syro? I am trying spring.resource, it throws an error.

and what is the bean name of the cachemanager instance? I need to configure something else?

+3
source share
1 answer

org.apache.shiro.cache.CacheManager Shiro SecurityManager. Shiro , CacheManager, AuthorizationInfo, Realm.

, , Grails Shiro, Shiro INI :

[main]
...
cacheManager = com.my.implementation.of.CacheManager
securityManager.cacheManager = $cacheManager
...

grails-user, , "grailsy" Grails Shiro.

,

+1

Source: https://habr.com/ru/post/1779910/


All Articles