From a86f3ed5914e095890db8d26e6b7485910b5dcad Mon Sep 17 00:00:00 2001 From: Christian Oestreich Date: Mon, 25 Jan 2016 09:18:42 -0600 Subject: [PATCH] Adding working example for "no roles" --- .../controllers/secured/SecureController.groovy | 11 +++++++++++ noroles/grails-app/views/index.gsp | 6 +----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 noroles/grails-app/controllers/secured/SecureController.groovy diff --git a/noroles/grails-app/controllers/secured/SecureController.groovy b/noroles/grails-app/controllers/secured/SecureController.groovy new file mode 100644 index 0000000..223f26c --- /dev/null +++ b/noroles/grails-app/controllers/secured/SecureController.groovy @@ -0,0 +1,11 @@ +package secured + +import grails.plugin.springsecurity.annotation.Secured + +class SecureController { + + @Secured('ROLE_NO_ROLES') + def index() { + render "You have ROLE_NO_ROLES: $principal" + } +} \ No newline at end of file diff --git a/noroles/grails-app/views/index.gsp b/noroles/grails-app/views/index.gsp index 5cd1d39..c06f18d 100644 --- a/noroles/grails-app/views/index.gsp +++ b/noroles/grails-app/views/index.gsp @@ -7,11 +7,7 @@