Last updated by walayni 9 months ago
grails install-plugin shiro-ui
Last updated by walayni 9 months ago
This plugin tries to provide a basic user interface for shiro plugin. It depends on the excellent
Apache shiro and
Mail plugins.
The ShiroDBRealm is used in this plugin, this assumes users, roles and permissions are stored in the database.
Installation
grails install-plugin shiro-ui
Feature summary
- User and Role management frontends with basic permission configuration : ${appName}/shiroUser/ and ${appName}/shiroRole/
- Password recovery via email : ${appName}/auth/lostPassword
- Password update : ${appName}/auth/updatePassword
- User creation by priviliged user with temporary password sent by email (password update is requested on log on)
During installation, all templates (controllers, domain classes and views) are directly copied to the project.
Admin user creation
Admin user creation can be done in the Bootstrap :
import org.apache.shiro.crypto.hash.Sha256Hashclass BootStrap { def init = { servletContext -> def adminRole = ShiroRole.findByName("Administrator") if(!adminRole){ adminRole = new ShiroRole(name: 'Administrator') adminRole.addToPermissions("*:*") adminRole.save() } def admin = ShiroUser.findByUsername('admin') if(!admin){ admin = new ShiroUser(firstName:"Administator",lastName:"User", username: 'admin', passwordHash: new Sha256Hash("changeit").toHex(),email:'someone@gmail.com') admin.save() adminRole.addToUsers(admin) adminRole.save()
} } def destroy = { }}Plugin RoadMap
- Allow custom permissions such as "book:buy,sell:1,2"
- External mail templates (now hardcoded in controller)
- Script to manually install templates
- User sign-up with admin approval
- Better documentation
Last updated by walayni 9 months ago
Unable to connect with login message "Invalid username and/or password"
Please check that an initial user is created (often in the BootStrap). More details in the "Admin user creation" in the description tab.
Still unable to connect after copying the bootstrap code (with login message "Invalid username and/or password")
Please make sure the bootstrap code was pasted before grails start.
Last updated by walayni 9 months ago