Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions noroles/grails-app/controllers/secured/SecureController.groovy
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 1 addition & 5 deletions noroles/grails-app/views/index.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

<ul>
<li><g:link controller='secure'>Anyone can access</g:link></li>
<li><g:link controller='secure' action='secure'>Must be authenticated</g:link></li>
<li><g:link controller='secure' action='sales'>Must have UserType.sales</g:link></li>
<li><g:link controller='secure' action='group1'>Must have businessUnit 'group1'</g:link></li>
<li><g:link controller='secure' action='group2'>Must have businessUnit 'group2'</g:link></li>
<li><g:link controller='secure' action='dev'>Must have developer=true</g:link></li>
<li><g:link controller='secure' action='index'>Must be authenticated</g:link></li>
</ul>

</body>
Expand Down