Grails Spring Security Core: Get users with specific ROLE -


i'm trying users follow criteria , have role_user.

criteria:

arraylist<user> users = user.createcriteria().list() {   inlist("gender", whichgenderlist)   ne("uid", uid)   profile {     inlist("age", whichage)   }   firstresult(usersperpage * currentpage)   maxresults(usersperpage) } 

question: possible add criteria condition select users role_user?

i'm using:

update:

minimal user table: enter image description here


role table:

enter image description here


userrole table:

enter image description here

  arraylist<user> users = user.createcriteria().list() {   inlist("gender", whichgenderlist)   ne("uid", uid)   role {      eq("authority","role_user")   }   profile {     inlist("age", whichage)   }   firstresult(usersperpage * currentpage)   maxresults(usersperpage) } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -