Skip to content

role_data

role_data returns JSON data selected by roles in the parsed claims.

yaml
server:
  http:
    middlewares:
      dashboard_data:
        role_data:
          map:
            - roles:
                - admin
              data:
                admin: true
            - roles:
                - auditor
              data:
                read_only: true
          default:
            authenticated: true
FieldDescription
map[].rolesRoles that activate this data entry.
map[].dataArbitrary JSON/YAML value appended when a role matches.
defaultValue appended to every response when set. Arrays are expanded into the response array.

role_data returns an array. Put session before role_data so claims are available.