Skip to content

Crash when reading PG table where user has no SELECT permissions #126

@KillerX

Description

@KillerX

It appears that if there is a table in the schema for which the connected user does not have at least SELECT permissions, the following error occurs:

TypeError: Cannot set properties of undefined (setting 'primary')
    at Postgres.<anonymous> (node_modules/@directus/schema/dist/dialects/postgres.js:128:58)
    at step (node_modules/@directus/schema/dist/dialects/postgres.js:67:23)
    at Object.next (cms/node_modules/@directus/schema/dist/dialects/postgres.js:48:53)
    at fulfilled (node_modules/@directus/schema/dist/dialects/postgres.js:39:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

I'm not sure what the correct response in this situation is. For my use case it would be enough to just ignore the table, but I am not sure if that is the correct response for other use cases where you might want the information that the table exists but you do not have access to it.
Either way at least a clear error message as to what is going on would go a long way, since now it is very unclear why the system crashes.

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