Skip to content

[Security] initialize_databases require list_db=True #58

Closed

Description

@loctv

In a use case with several databases, at initial database step call "odoo.service.db.exp_list(True)" to get all explicit db names. This was only accepted with config list_db=True. But I want to prevent listing databases entirely and use db_filter option.

# queue_job/runner.py
def get_db_names(self):
        if odoo.tools.config['db_name']:
            db_names = odoo.tools.config['db_name'].split(',')
        else:
            db_names = odoo.service.db.exp_list(True)
        return db_names
# odoo/service/db.py
def exp_list(document=False):
    if not odoo.tools.config['list_db']:
        raise odoo.exceptions.AccessDenied()
    return list_dbs()

Activity

  1. guewen commented on Feb 23, 2018

    @guewen
    Member

    Hi,

    You have to set the db_name value (or --database in CLI) to the list of databases you want to use (separated by commas). This list of databases will be used by the cron and by the queue job.
    db_filter is an option for the front-end.

  2. added 2 commits that reference this issue on Oct 16, 2020
    22a7c27
    abf7fac
  3. added 2 commits that reference this issue on Oct 25, 2021
    c5a42fa
    5355341
  4. eLBati commented on Oct 26, 2021

    @eLBati
    Member

    @guewen @loctv please have a look at #379

  5. added 4 commits that reference this issue on Nov 23, 2023
    69bdcaf
    582c8c9
    68b6eb6
    d3f57b8
  6. added 2 commits that reference this issue on Nov 25, 2023
    d7c0ca3
    58f66d9
  7. NightTsarina commented on Jun 27, 2024

    @NightTsarina

    Hi, this issue has been solved for v11 (#665), v12 (#379), v15 (#580), and v16 (#589); but two proposed fixes for v14 (#416 and #588) were not merged. Is there any chance this will be fixed for v14?

  8. added 4 commits that reference this issue on Sep 19, 2024
    c29e1c0
    1e71684
    eb745e8
    cf656a6
  9. added 2 commits that reference this issue on Oct 7, 2024
    6eb2ca9
    dcdc2a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions