Core
Framework v2.x
2

profiles() #

Available since 2.14.0

Loads profiles into the app.

This method is idempotent. If a profile is defined multiple times, only the last definition will be retained.

This method can only be used before the application is started.

Copied to clipboard!
profiles(profiles: JSONObject): void

Argument Type Description
profiles
JSONObject
Object containing profiles and their definitions.

Usage #

Copied to clipboard!
app.import.profiles({
  profileA: {
    rateLimit: 50,
    policies: [
      {
        roleId: 'roleA'
      },
      {
        roleId: 'roleB',
        restrictedTo: [
          {
            index: 'index1'
          },
          {
            index: 'index2',
            collections: [ 'collectionA', 'collectionB']
          }
        ]
      }
    ]
  },
  profileB: {
    policies: [
      { roleId: 'roleA' }
    ]
  },
})