0

I'm following this tutorial https://grails-plugins.github.io/grails-spring-security-core/guide/tutorials.html, but @Secured annotation cannot be resolved, though I applied Spring Security plugin and compiled.

import grails.plugin.springsecurity.annotation.Secured
class SecureController {
   @Secured('ROLE_ADMIN')
   def index() {
      render 'Secure access only'
   }
}
tim_yates
  • 167,322
  • 27
  • 342
  • 338
Margarita Spasskaya
  • 643
  • 2
  • 10
  • 24
  • whats your build file looks like ? (either build.gradle for 3.x or buildconfig.groovy) – Frederic Henri Sep 22 '15 at 08:35
  • build.gradle dependencies { … compile 'org.grails.plugins:spring-security-core:3.0.0.M1' compile "org.springframework.security:spring-security-core:4.0.1.RELEASE" compile "org.springframework.security:spring-security-web:4.0.2.RELEASE" … } – Margarita Spasskaya Sep 22 '15 at 08:42

1 Answers1

0

You applied the spring-security libraries, but not the spring-security-core plugin.

The dependency for the plugin look like:

plugins {
  compile ':spring-security-core:2.0-RC5'
}
injecteer
  • 20,038
  • 4
  • 45
  • 89