Results 1 to 4 of 4

Thread: Most flexible way to use intercept-url

  1. #1

    Question Most flexible way to use intercept-url

    I'm using jdbc-user-service way... that's nice. Solve almost 100% of my problem. I'm using to write the pattern:
    Code:
    <intercept-url pattern="/support_index.xhtml*" access="SUPPORT"/>
    <intercept-url pattern="/support_admin.xhtml*" access="SUPPORT"/>
    <intercept-url pattern="/support_menu.xhtml*" access="SUPPORT"/>
    But I'm not very happy with this.. I would like to use it with data coming from the DataBase...

    I mean add Page("/support*"); and associated it with Role.add(page) dynamically.... What strategic should I follow?

    ps: I already know how to put data on DB I just want to know how can I let the url and role association dynamic... (such as using jdbc-user-service ...)

  2. #2

    Cool

    I guess it http://static.springsource.org/sprin...c-url-metadata is the answer... I'll study it.

  3. #3

    Default

    Based on http://static.springsource.org/sprin...c-url-metadata

    In ConfigAttribute object I just return the ROLE string... (implementatio of getAttribute()) for that url ? isn't?

    Code:
            FilterInvocation fi = (FilterInvocation) object; 
            String url = fi.getRequestUrl();
            String httpMethod = fi.getRequest().getMethod();
            List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>();
            attributes.add(new ConfigAttribute(){
                                   public String getAttribute(){return "admin";}          
                                });
            return attributes;
    is something like that?
    and where can I put this bean... on xml ? (shoud I need to write a FilterChainProxy ?)
    Last edited by dreampeppers99; Oct 1st, 2009 at 09:29 AM.

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    If you're writing a custom SecurityMetadataSource (the 3.0 interface name), then you can't use the namespace <http> element. You have to configure the FilterChainProxy explicitly.

    The ConfigAttribute values contain the attribute data you want. They can be plain strings (use the SecurityConfig class) or specialized implementations containing information which a custom voter might need.
    Spring - by Pivotal
    twitter @tekul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •