For AI agents: the complete documentation index is available at https://docs.dataplatform.ovh.net/llms.txt, the full documentation bundle is available at https://docs.dataplatform.ovh.net/llms-full.txt, and this page is available as Markdown at https://docs.dataplatform.ovh.net/sdk/api-qb-acl.md.
  • 🇬🇧 English
  • Customize Analytics Manager ACL rules in Front API

    Warning

    Rework pending, no delivery date. The Front App SDK (ReactJS) and the Front API SDK (NodeJS) are both being replaced. This page documents the current release, remains accurate, and is maintained until the replacement ships. Code written against it keeps working.

    Warning

    The extension qb must be installed.

    Create a file: /src/qb/services/ACL.js from this template:

    module.exports = async (req,query,dataset)=> {
        return query
    }

    For the moment no rules will be applied.

    From this function you will be able to :

    • Disallow the user to make the query OR
    • Update the query content by adding field inside the query (filter for example)

    A complete example :

    // This function is called each time you launch a query from the Front API,
    // and allows you to intercept it. 
    // thus you can easily forbid a query or modify it (in order to apply a filter) 
    
    module.exports = async (req,query,dataset)=> \{
    
    // req.authentication.session contains the object provided by IAM 
    // or your custom authentication
    
    // If you wish to deny certain requests for non-admins.
    if(query.data.fields.quantity && !req.authentication.session.isAdmin) \{
        let err = new Error('QuantityNotAuthorized')
        err.status = 401
        throw err
    \}
    
    // If you need to apply a filter for non-admin
    if(!req.authentication.session.isAdmin) \{
        query.filter = query.filter || \{\}
        query.filter.company = \{
            in:["Data Platform"]
        \}
    \}
    
    return query

    Go further

    If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.

    Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated Discord channel.

    If you need support with your OVHcloud services, create a request in our Help Centre.

    Join our community of users.