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

Add custom permission check to update operation on the changed data #384

@techninja1008

Description

@techninja1008

Currently, on the permissions check on an update operation, the check is only run on the row before it is modified. It would also make sense to add a check to make sure that the modification is valid.

Example use case:

  1. You have a table of users and a table of (for example) cars.

  2. Each car has a reference (with a foreign key constraint) to a car.

  3. You want users to be able to update their car entries using criteria including the user_id, so you allow them access to it on the update permission.

  4. Currently: You have a problem, as they can now change the user_id column to someone else, when the application was designed for other users to be completely invisible.

    With suggestion: You add a check so that the user_id field after modification must still equal X-HASURA-USER-ID, and everything works fine.

Metadata

Metadata

Assignees

Labels

c/serverRelated to servere/intermediatecan be wrapped up in a weekk/enhancementNew feature or improve an existing featurep/highcandidate for being included in the upcoming sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions