cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Accessing graphql context inside auth rules

Hi,

Using the Neo4j Graph Plateform library, is it possible to access the context (graphql) in auth rules.

I know I can access $jwt and do something like this :

{ allow: { id: "$jwt.sub" }

But I would like to do something like this :

allow: { OR: [{ id: "$jwt.sub" }, { adminOverride: true }] }

And pass this config adminOverride like this :

const User = context.ogm.model("User")
    const [existing] = await User.update({
      where: { id: payload.sub },
      context: { ...context, adminOverride: true },
      update: { password: hash },
    })

Thanks for your help!

0 REPLIES 0