Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-115

prevent deleting important data

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 1.3.0
    • 1.3.0
    • API
    • None

    Description

      When running an ant task that deletes db tables or data (e.g. init schema or unit tests), or when running directly from java or eclipse (e.g. init schema or unit tests), the user is not prompted to confirm if the right DB is going to be affected.

      So, now there is a prompt before deleting tables or data:

      (note, you can whitelist or blacklist db urls and users in the grouper.properties)
      Are you sure you want to delete all grouper data in db user 'grouper', db url 'jdbc:mysql://localhost:3306/grouper'? (y|n):
      y

      This will show the db username and the db url which will be affected. Also it will tell you what will happen (e.g. delete all grouper data, or delete / recreate all grouper tables).

      If you know that particular schemas are development data and will be deleting data or tables often, and you want to circumvent this prompt there, you can whitelist that urls / users in the grouper.properties. If you know that particular schemas are production data, and you dont ever want to delete tables / data there even with a prompt (unless the user changes the grouper.properties), you can blacklist those urls / schemas in the grouper.properties. Each whitelist or blacklist addition requires two grouper.properties entries (one for user, one for url), and the indexes must be sequential.

      1. whitelist (allow) and blacklist (deny) for db data or object deletes.
      2. if a listing is in the whitelist (allow), it will be allowed to delete db
      3. if a listing is in the blacklist (deny), it will be denied from deleting db
      4. multiple inputs can be entered with .0, .1, .2, etc. These numbers must be sequential, starting with 0
        db.change.allow.user.0=grouper3
        db.change.allow.url.0=jdbc:mysql://localhost:3306/grouper3
        db.change.allow.user.1=grouper1
        db.change.allow.url.1=jdbc:mysql://localhost:3306/grouper1

      db.change.deny.user.0=grouper2
      db.change.deny.url.0=jdbc:mysql://localhost:3306/grouper2

      Attachments

        Activity

          People

            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: