question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL functions in row select permission

See original GitHub issue

Is it possible to define SQL functions in row select permissions? Something like this does not seem to work currently:

{"_and":[{"date":{"_gte":"current_date - 1"}},{"date":{"_lte":"current_date + 1"}}]}

Date is a column of type Date. I would like to restrict the SELECT permission, to only allow rows having date between yesterday and tomorrow. Thanks.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:63
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mrob11commented, Oct 23, 2019

+1 for this feature. Use case for me is limiting the number of possible rows inserted for a user based on a value in another table (e.g. limited number of records for given subscription tier).

2reactions
rossngcommented, Dec 3, 2021

I’d be interested in having this functionality for implementing a Zanzibar-style authorization model. Hasura’s permission syntax is currently limited by its inability (as far as I can tell) to traverse relations recursively.

References:

Read more comments on GitHub >

github_iconTop Results From Across the Web

GRANT Object Permissions (Transact-SQL) - Microsoft Learn
Specifies the name of a column in a table, view, or table-valued function on which the permission is being granted. The parentheses (...
Read more >
How to Implement Row and Column Level Security in SQL ...
SELECT — Principals requires this permission to get or read data from the table. INSERT — Principals need this permission to add new...
Read more >
Introduction to Row-Level Security in SQL Server
A master user may be able to view all the records in the table. However, when a specific user logs in, the Row-Level...
Read more >
No users or roles have SELECT permission on the SQL ...
No users or roles have SELECT permission on the SQL Server table but a user is able to select rows from it ·...
Read more >
CREATE PERMISSION - Db2 SQL - IBM
If the reference of the table is for a fetch operation such as SELECT, the application of the row permission determines what set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found