这是indexloc提供的服务,不要输入任何密码
Skip to content

when permissions are missing for column: return null values instead of dropping the column #6541

@barbalex

Description

@barbalex

In our app there are different roles. For the first time now I am encountering the situation that one role needs to not access the data of a few columns in a table.

So I removed the permission for the column lokalname in the console to test this.

But then every query that tries to access the column returns this error:

{
  "errors": [
    {
      "extensions": {
        "path": "$.selectionSet.herkunft.selectionSet.lokalname",
        "code": "validation-failed"
      },
      "message": "field \"lokalname\" not found in type: 'herkunft'"
    }
  ]
}

This is hard to solve. We use subscriptions. And store the data locally, as this app is offline capable.
The thing that breaks first are the subscriptions. But it is also pretty hard to solve the case of data structure changing in the local store, depending on the role the user has.

This is why the behavior we would like to see is: The api returns the exact same data structure, no matter what columns the user is allowed to access. But columns that the user is not allowed to access contain only null values.

Is this achievable?

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