Skip to content

Issue with Applying Privileges for All Schemas #608

@erin-nielsen

Description

@erin-nielsen

Hello!

I am having an issue with the YML specifically the "grant" tag, using version 6.

The documentation states for ldap2pg v4.0 (https://ldap2pg.readthedocs.io/en/latest/changelog/?h=__all__#ldap2pg-40)
Deprecation: schema __all__ should be used instead of __all__

The following YML snippet will not pick up ANY schemas to set the privileges. And does not work for either the --config or --real option.

grant:
  - privilege: ro
    role: readers
    schemas: __all__    
  - privilege: rw
    role: writers
  - privilege: ddl
    role: owners

The following YML snippet will yield the correct results with the --config option, however when I run with the --real option we encounter the following error that seems to indicate that this token is not being replaced and it is using it as a literal value.

ERROR Fatal error. err="stage 2: apply: sync: ERROR: schema \"schema __all__\" does not exist (SQLSTATE 3F000)"

grant:
  - privilege: ro
    role: readers
    schemas: schema __all__    
  - privilege: rw
    role: writers
  - privilege: ddl
    role: owners

A work-around is to specify each schema name which DOES grant privileges correctly however, the requirement is for this to be dynamic if new schemas are being created. Therefore, this work-around is not acceptable.

grant:
  - privilege: ro
    role: readers
    schemas: [apple,orange]
    database: prime    
  - privilege: rw
    role: writers   
  - privilege: ddl
    role: owners

Is there another way to achieve the grant privileges to all schemas?

Thank you!
Erin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions