prorm API Reference
    Preparing search index...

    Function canViewField

    • Check whether a given role can VIEW a field on a model.

      Resolution order:

      1. Field-level cannotView → deny if role is listed
      2. Field-level canView → allow only if role is listed (or '*' present)
      3. Model-level cannotView → deny if role is listed
      4. Model-level canView → allow only if role is listed (or '*' present)
      5. Default: allow

      Parameters

      • ModelClass: Function

        The model constructor

      • fieldName: string

        The attribute name to check

      • role: string

        The current user's role

      Returns boolean