How to ad users using A shiro Plugin
I am using Shiro plugin for my grails application security, My applica开发者_JS百科tion already has a user .Using the shiro plugin, we get a shiro user, now how do i integrate the shiro user with the normal user of my application,show i go ahead and use relationships or is it that the user class ahould be only a shiro user class now ??
The Grails Shiro Plugin auto-generates the ShiroUser class as a starting point that you can use directly, or, if you don't want to use it, an example that helps you configure your own data model to work similarly. It is totally ok to use your own classes instead.
And in my opinion, it is a good thing to use your own classes: there are less classes to maintain and you have Shiro work with your existing data model rather than forcing you to use new classes and/or interfaces. The Grails plugin creates these things as a convenience to reduce the time it takes for you to get up and running, but you don't need to use them if you don't want to.
Using the ShiroUser class (and even further, using the Nimble plugin, which is built on top of Shiro) is all about convenience - how much do you prefer to use something that already exists (with the caveat that it may not meet all of your needs) vs how quickly do you want to get up and running.
Cheers,
Les
Apache Shiro PMC Chair & Katasoft Inc. Founder: Application Security Products & Professional Apache Shiro Support and Training: http://www.katasoft.com
Check out the nimble plugin which does exactly this and more:
http://www.grails.org/plugin/nimble
精彩评论