Skip to content

Conversation

@gcsantos-gpa
Copy link
Contributor

@gcsantos-gpa gcsantos-gpa commented Jan 12, 2026

This PR implements claim checking as an additional security measure to filter data through a tableoperations wrapper in model controllers.

JIRA Ticket(s)
Additional Support for: DIG-21
Ticket: DIG-22

Required PRs

@gcsantos-gpa gcsantos-gpa self-assigned this Jan 12, 2026
@gcsantos-gpa gcsantos-gpa changed the base branch from master to development January 16, 2026 19:14
await tableOperations.DeleteRecordAsync(record, cancellationToken);
SecureTableOperations<T> tableOperations = new(connection);
object primaryKey = tableOperations.BaseOperations.GetPrimaryKeys(record).First();
await tableOperations.DeleteRecordWhereAsync(HttpContext.User, $"{PrimaryKeyField} = {{0}}", cancellationToken, primaryKey);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing this call?
Shouldn't we use
await tableOperations.DeleteRecordAsync(HttpContext.User, record, cancellationToken);

SecureTableOperations<T> tableOperations = new(connection);

T? result = tableOperations.NewRecord();
T? result = tableOperations.BaseOperations.NewRecord();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for cleaner operation let's add NewRecord to SecureTableOperations

TableOperations<T> tableOperations = new(connection);
string tableName = tableOperations.TableName;
SecureTableOperations<T> tableOperations = new(connection);
string tableName = tableOperations.BaseOperations.TableName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
string tableName = tableOperations.BaseOperations.TableName;
string tableName = tableOperations.TableName;

Let's handle this in SecureTableOperations There are ways to have optional parameters in an interface definition., That would allow SecureTableOeprationsto beITableOperations` which I think makes this cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants