In my grails app i am using spring security plugin..I have registration form and registered users will be stored in db table.
in bootstrap i have created new role as, def PhysicianRole = new Role(authority: 'ROLE_PHYSICIAN').save(flush: true)
Then i have another form where admin is enabling or disabling users from table.
now i want to assign physician role to all the users who are enabled.so i did as below in bootstrap, def physicians=Physician.findAllWhere(enabled:true) with this i am getting array list as,
physicians-------------->[com.HospitalManagement.User : 1, com.HospitalManagement.User : 2, com.HospitalManagement.User : 4, com.HospitalManagement.User : 5, com.HospitalManagement.User : 6, com.HospitalManagement.User : 7]
now how should i assign physician role to all the objects in this array list?