access control, role and permission in grails
问题 I am working on a grails application for the first time and I now want to protect some pages to be viewed only by admins, and give some permissions to other users. I am using Apache Shiro plugin for grails. My sample code in the bootstrap looks like this class BootStrap { def init = { servletContext -> def adminRole if(ShiroRole.findByName("Admin".isEmpty())){ adminRole = new ShiroRole(name: "Administrator") adminRole.addToPermissions("*:*") adminRole.addToPermissions("admin") adminRole.save(