Take the 2-minute tour ×

How can I retrieve an existing ShiroRole that I've already created and stored in the database?

I've noticed that you can retrieve an existing ShiroUser by calling ShiroUser.findByUserName("somename") but I haven't found a method in ShiroRole that appears to do the same in finding the role by name.

I'm using the Apache Shiro Grails Plugin


share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If you're using the Shiro Grails Plugin and the ShiroRole that it installs by default, it's really just a standard Grails domain class, so you should be able to do ShiroRole.findByName('roleName').

share|improve this answer
Okay it was a dumb question, but thank you for your help. –  leeand00 Sep 21 '11 at 19:21
add comment

Your Answer


