Skip to content

security: Add support for another column along with autoincrment column in where clause in update statement #430

Description

@Pritamhars

Currently when we update object/struct if it has autoincrement field, then unable to add 1 more column to where clause in update.
eg: Suppose we have multiple tenants having tenant_name column along with ID as an auto increment column.
When we update object, it uses only autoincrement ID field in where clause. What if we will change ID( of another tenant) and then update. Then it will update all fields of another tenant.
So If we have 1 more column support in where clause, then it will solve multi tenant issue.
eg: update table_name set .. ** where ID=123 AND tenant_name='tenant1'.**
Hope You got the problem.

table cols: ID, tenant_name, name, description,...
db.AddTableWithName(struct{}, "table_name").SetKeys(true, "id")

Activity

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