Announcement Announcement Module
Collapse
No announcement yet.
Most flexible way to use intercept-url Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    I guess it http://static.springsource.org/sprin...c-url-metadata is the answer... I'll study it.

    Comment


    • #3
      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, 10:29 AM.

      Comment


      • #4
        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.

        Comment

        Working...
        X