Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:53:14+00:00 2026-06-01T21:53:14+00:00

In the supports(Class clazz) method of RoleVoter , it always returns true saying that

  • 0

In the supports(Class clazz) method of RoleVoter, it always returns true saying that

This implementation supports any type of class, because it does not
query the presented secure object.

What is this “presented secure object“. On the other hand, the supports(Class clazz) method of WebExpressionVoter returns true only if clazz is a subtype of FilterInvocation. Is FilterInvocation the “presented secure object” here and why does the voter has to support it ?

If I use @Secured annotations over my methods and configure an access decision manager for global method security that has WebExpressionVoter as one of the voters, it presents an error

AccessDecisionManager does not support secure object class: interface
org.aopalliance.intercept.MethodInvocation

This is because all voters of an access decision manager (when configured for method security) must support the above class, and while RoleVoter and others do, WebExpressionVoter needs a subtype of FilterInvocation.

SPEL expressions in @PreAuthorize tag would also need WebExpressionVoter, and again it would be required to support MethodInvocation class, which it doesn’t. But it does work. So what am I getting wrong here ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:53:16+00:00Added an answer on June 1, 2026 at 9:53 pm

    The secured object is an abstract representing whatever is secured. It may be a MethodInvocation in case of @Secured, @RolesAllowed, @PreFilter and @PreAuthorize, or a FilterInvocation in case of <intercept-url /> or any other object if required.

    The @PreFilter and @PreAuthorize annotations are handled by PreInvocationAuthorizationAdviceVoter. It uses the MethodInvocation to get the annotations and their attributes values, so it has:

    public boolean supports(Class<?> clazz) {
        return clazz.isAssignableFrom(MethodInvocation.class);
    }
    

    The WebExpressionVoter is web-invocation specific, because it matches the URL to the patterns from <intercept-url />, that’s why it has:

    public boolean supports(Class<?> clazz) {
        return clazz.isAssignableFrom(FilterInvocation.class);
    }
    

    The RoleVoter only uses the Authentication object contents, so it does not depend on the secured object, and that’s why it has:

    public boolean supports(Class<?> clazz) {
        return true;
    }
    

    Note, that You can have a separate AccessDecisionManager for URL level security and method level security. The first will use voters that support FilterInvocation, and the other the ones that support MethodInvocation. Also note that RoleVoter supports both so it can be used in both contexts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop a class that supports an asynchronus method invocation. This is
Does Castle ActiveRecord's ActiveRecordMediator<> class support LINQ queries? I couldn't find any method that
I'm looking for a java socks Proxy client class that supports authetication, any suggestions?
Is there any class that supports Dance pad in XNA? Maybe it's treated just
I want to define a class that supports __getitem__ , but does not allow
I'm building a generic Repository<T> class that supports Linq to SQL, and I'd like
Ok, just wondering on the versions of PHP that this class is built into.
The JAX-RS implementation Jersey supports MVC style web applications through the Viewable class, which
I'm working on serializing a class that supports NSCoding. I've setup encodeWithCoder and initWithCoder
code is like this: @Controller public class TestController { @RequestMapping(value = /testerror, method =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.