prorm API Reference
    Preparing search index...

    Function getAllowedAttributes

    • Return the list of field names on a model that role is allowed to VIEW.

      Useful for passing to findAll({ attributes: ... }) to prevent loading restricted data at the database level.

      Parameters

      • ModelClass: Function

        The model constructor

      • role: string

        The current user's role

      • OptionalallAttributes: string[]

        The full list of attribute names. If omitted, the registry's field rules are used as the universe (only fields with explicit rules are considered).

      Returns string[]