Skip to content

Instantly share code, notes, and snippets.

View mstine's full-sized avatar

Matt Stine mstine

View GitHub Profile
controllerAnnotationStaticRules = [
'/blurb/**': ['ROLE_ADMIN'],
‘/setting/**’: ['ROLE_ADMIN']
]
import org.codehaus.groovy.grails.plugins.springsecurity.Secured
@Secured(['ROLE_ADMIN'])
class ProductController {
//...
}
@Secured(['ROLE_ADMIN'])
def create = {
public class AuthFilters {
def authenticateService
def filters = {
blurbCheck(controller: 'blurb') {
before = {
if (authenticateService.ifAllGranted('ROLE_ADMIN')) {
security {
// see DefaultSecurityConfig.groovy for all settable/overridable properties
active = true
loginUserDomainClass = "com.mattstine.wendysstore.domain.User"
authorityDomainClass = "com.mattstine.wendysstore.domain.Role"
useRequestMapDomainClass = false