sapmentors / cap-community

SAP CAP Community
MIT License
97 stars 26 forks source link

$user in where-clause not working? #56

Closed wattnu closed 4 years ago

wattnu commented 4 years ago

Dear CAP-Team, In my Bookshop-style sample, I want to introduce the following service:

service CatalogService {
    @readonly
    entity myOrders as select from domain.Orders {
            ID, orderNo, Items
        } where createdBy = $user.id;
}

It seems that the pseudo-variable $user.id is not evaluated properly (I also tried $user). domain.Orders is including the usual managed-aspect. When I'm importing csv-data, or doing POST requests, $user is set to "anoynmous". Using explicitely where createdBy = 'anonymous' is retrieving these data sets, whereas the above query returns an empty data set.

Is this a known issue?

Thanks Klaus

wattnu commented 4 years ago

I also posted this question here: https://answers.sap.com/questions/13007986/user-in-where-clause-not-working.html

wattnu commented 4 years ago

Answered by https://answers.sap.com/questions/13007986/user-in-where-clause-not-working.html