{
  "rules": {
    "songs": {
      ".read": true,
      ".indexOn": ["createdBy"],
      "$id": {
        ".write": "auth != null"
      }
    },
    "users": {
      ".read": true,
      "$uid": {
        ".write": "auth != null && auth.uid == $uid"
      }
    }
  }
}

{
  "rules": {
    "songs": {
      ".read": true,
      ".indexOn": ["createdBy"],
      "$id": {
        ".write": "auth != null && (!data.exists() || data.child('createdBy').val() === auth.uid)"
      }
    },
    "users": {
      ".read": true,
      "$uid": {
        ".write": "auth != null && auth.uid == $uid"
      }
    }
  }
}

Allow to edit song only for its creator.
Allow to edit song only for its creator.
