Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What I'm missing with SpringSecurity?

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I'm trying to integrate SpringSecurity plugin into out Grails application.
The admin should be able to access all aspects of ContractController, so I tried:
/contract/**
ROLE_ADMIN
Every thing works fine (I got the login form and I'm able to access all ContractController functionality).
The client should only be able to show a contract, so I tried:
/contract/show/**
ROLE_CLIENT
But upon trying to login as a a client, I didn't got the login form and I'm able to access all aspects of ContractController.
Am I missing something in SpringSecurity?
Should I guard all the controllers this way:
/controller/**
And then restrict access in the controllers via annotations?
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Up to this point I've used only the annotations. I haven't needed to dynamically modify access control which is what the RequestMap method allows you to do. So I can't really answer your question except to say that by solely using Annotations, you'll be able to achieve what you want.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, did you log out?

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also use the @Secured Annotation on my controller methods and class.

I actually have an opposite problem in my app where I have no security on some controller and methods, but it is blocking my user from accessing it, but I digress.

I think if you have a link on the page where the post action is j_security_logout or j_security_check_logout, the it will clear out the SecurityContext for you.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic