See the light - agile, industrial strength, rapid web application development made easy

(Quick Reference) # 14.5.2 Shiro - Reference Documentation Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari Version: 2.3.8 ## 14.5.2 Shiro Shiro is a Java POJO-oriented security framework that provides a default domain model that models realms, users, roles and permissions. With Shiro you extend a controller base class called `JsecAuthBase` in each controller you want secured and then provide an `accessControl` block to setup the roles. An example below:

    class ExampleController extends JsecAuthBase {
        static accessControl = {
            // All actions require the 'Observer' role.
            role(name: 'Observer')        // The 'edit' action requires the 'Administrator' role.
            role(name: 'Administrator', action: 'edit')        // Alternatively, several actions can be specified.
            role(name: 'Administrator', only: [ 'create', 'edit', 'save', 'update' ])
        }
        …
    }
For more information on the Shiro plugin refer to the documentation. | Quick Reference (hide)