- Data apps
- MCP Servers with Text-To-SQL
- AI Chatbots
User authentication
In order to apply row-level permissions, each individual user in the client must be authenticated and known to Peliqan. This means that e.g. a shared API key cannot be used. Instead SSO (Single Sign On) with e.g. oAuth is appropriate.User authentication in Data Apps
More info: Publish & Embed appsUser authentication in MCP Servers using oAuth
More info: Build a custom MCP Server on Peliqan with OAuthUser authentication in AI Chatbots
In order to apply permissions, the user id must be captured from the chat. Here’s an example setup in n8n using the n8n Chat Embed Widget:- Parent webpage with login screen
- After login, send
user_idinto n8n Chat Embed Widget - Retrieve
user_idin n8n workflow - Execute SQL query (for Text-to-SQL and RAG) via a Peliqan custom API endpoint
- Make sure the
user_idis also sent to the API endpoint - Peliqan applies permissions (row level access) in the API handler script
- Peliqan executes the query and sends the result back to the AI Agent
Applying row-level permissions in queries
Row level access is implemented by providing the client with a set of views, making sure each view has a fixed column on which permissions can be applied (e.g.user_role).
The views are invoked with a filter (e.g. a filter on user_role) and then prepended to the SQL query that the client wants to execute as CTEs.
Example with user mappings
Coming soon.Example with group mappings
In this example, we assume that users have one single user role, user roles have permissions on zero, one or more departments and all resources are linked to one single department. Example description of the Data model which is exposed to the client:
Example table with mapping of permissions:
Example table with users, each user has one user_role:
Example access views to apply permissions:
Final executed query for Anne, with user_role = ‘Finance Manager’:
