Spring Security
  1. Spring Security
  2. SEC-1421

JdbcUserDetailsManager is missing setters for group management sqls

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.1.0.M1
    • Component/s: Core
    • Labels:
      None

      Description

      The JdbcUserDetailsManager class is missing just about all the setters for the SQL statements used for the group management functions. This renders the class useless in any form other than the default configuration.

      I was basically setting up a subclass which would have a setter method like this:

      public void setTablePrefix(String prefix) {
        String usersTable = prefix + "users";
        String authoritiesTable = prefix + "authorities";
        String groupAuthoritiesTable = prefix + "group_authorities";
        String groupsTable = prefix + "groups";
        String groupMembersTable = prefix + "group_members";
      
        setCreateUserSql(DEF_CREATE_USER_SQL.replace("into users", "into " + usersTable));
        ...
      }
      

      however, when i get to the point of doing all the group management sql statements, I realized there are no setters for these sqls (things like insertGroupAuthoritySql and so forth). This means I can't change their value, as they are private fields. I realize I could probably use reflection and gain direct access to the Field and set it that way, but it's not ideal, and won't necessarily work in all environments.

      While we're on the subject, a class like this (and it's counterpart for JdbcDaoImpl) would probably be a good candidate for inclusion into the API itself, as I think it would be a common thing people would want to do.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            matthew inger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: