Include 'user.role' in content/asset event

Can user.role be included in the content and asset event for use within rule expressions, please?
It’s available in Schema scripts and would be useful in Rules too.

Taken from the documentation, this is an abbreviated example of how it would look:

    {
      ...
    "pixelWidth": 800,
    "timestamp": "2018-01-01T12:00:00Z",
    "type": "Created", // The type of the event.
    "user": { // User information
        "id": "123...",
        "name": "John Doe",
        "email": "john@email.com",
        **"role": ["Creator"],** //An array like in Schema scripts
    },
    "version": 1 // Version of the asset, increased with any operation
}

https://docs.squidex.io/02-documentation/concepts/rules

Thanks
Michael

Makes sense, but what is your use case?

1 Like

Thanks,

Simple example,

  • if a user in role ‘Creator’ creates an asset
  • send an email to let someone know to check it

Complex example,

  • if a user in role ‘Designer’ creates an asset
  • add message to azure queue
  • message is processed and calls api to add tag ‘design’ to the asset

Thanks for your help
Michael

1 Like