Skip to content

OrderByClauseInUrl contain backing column names leading to failure at Column Authorization stage #650

Description

@ayush3797

What is the issue?
While working on this issue : #567 , there were a lot of failures in test cases, one of which was failure of this Test: FindTestWithDifferentMappedFieldsAndOrderBy(), and there are other tests similar to this one.

As it turned out, the request failed in AuthorizationResolver.AreColumnsAllowedForAction() authorization check stage. On closer inspection, I found out that the issue is arising because the RestRequestContext.OrderByClauseInUrl (which is a list of OrderByColumns) has the column names already as backing columns.
(See how the OrderByClause is populated in RequestParser.GenerateOrderByList()).

The expectation in AuthorizationResolver.AreColumnsAllowedForAction() is that the columns argument passed to it has exposedColumnNames, and not backing column names. However the OrderByClauseInUrl has backing column names, which are added to the column IEnum, and hence we don't find a mapping from a backing column name and we get an exception at AuthorizationResolver.AreColumnsAllowedForAction() , Line 143.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions