Results 1 to 3 of 3

Thread: Fetch custom authorities from database by operation name

  1. #1

    Default Fetch custom authorities from database by operation name

    Originally posted here.

    I need to make a legacy application start using spring security 3.
    This app already has its security data model. The follow diagram illustrates:


    Very simple by far. I can write my custom usersByUsernameQuery and authoritiesByUsernameQuery.

    The thing is that there is another table indicating the operation (i.e. @Service layer method) that a Role can execute:



    So the administrator can enable/disable a role from accessing an operation through a web interface, without redeploying the app.

    I don't want (for now) ended up creating my own annotation. Unless it is not possible with what we have out of the box.

    I still can annotate the business methods with @Secure('ROLE_ADMIN') for example, but my custom UserDetailsService must know at least the method name that is being secured, so I can perform the right query. Is there any way?

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    I'm not sure I understand what you are trying to do, but it sounds a bit like ACLs. See the contacts sample application for an example of using permissions/acls.
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3

    Default

    Quote Originally Posted by rwinch View Post
    I'm not sure I understand what you are trying to do, but it sounds a bit like ACLs. See the contacts sample application for an example of using permissions/acls.
    It sounds a bit like ACLs indeed. But I've already implemented some security backgrounds that uses ACLs and I can say that ACLs is really too fine grained for this case.
    What I've ended up doing was treating the Operation table like it was a Roles table. Some tweaks in the default SQL queries and it works well. Soon I'll detail here what was done.

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
  •