RLS DSL - v0.1.0
    Preparing search index...

    Function hasRole

    • Helper function to check if user has a specific role

      Parameters

      • role: string

        Role name to check

      • userRolesTable: string = "user_roles"

        Table containing user roles (default: 'user_roles')

      Returns ConditionChain

      A ConditionChain that can be chained with .and() or .or()

      policy('admin_access')
      .on('admin_data')
      .for('SELECT')
      .when(hasRole('admin'))