the overall app is complicated but the issue can be illustrated with four tables
USERS
CLIENTS
USERASSIGNMENTS
TASKS
login credentials are contained in USERS
USERS can be assigned to multiple CLIENTS by using records in USERASSIGNMENTS that contain a unique userID and a unique clientID
each record in TASKS has a userID field and a clientID field
----
in order to secure the database I need to be able to limit record access so that a user can access only tasks related to the client they are working in at the moment
the only way I have found to achieve this (to get the clientID as one of the fields available in the authentication dropdown for RLS) is to have the clientID as a third authentication element, but this requires users to logout and re authenticate every time they start working on a new client's tasks. That is not a workable solution in our use case.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
JoeyBrannon
the overall app is complicated but the issue can be illustrated with four tables
USERS
CLIENTS
USERASSIGNMENTS
TASKS
login credentials are contained in USERS
USERS can be assigned to multiple CLIENTS by using records in USERASSIGNMENTS that contain a unique userID and a unique clientID
each record in TASKS has a userID field and a clientID field
----
in order to secure the database I need to be able to limit record access so that a user can access only tasks related to the client they are working in at the moment
the only way I have found to achieve this (to get the clientID as one of the fields available in the authentication dropdown for RLS) is to have the clientID as a third authentication element, but this requires users to logout and re authenticate every time they start working on a new client's tasks. That is not a workable solution in our use case.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.