Class PermissionObjects

java.lang.Object
com.axelor.ai.governance.access.PermissionObjects

public final class PermissionObjects extends Object
What an agent's permission or a restriction names: a model's full name, a package ( com.axelor.sale.db.*, no sub-packages), a custom model's name, or * for every model.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    The object as a permission names it, from a name a person or an agent wrote: an entity's simple name becomes its full name.
    static boolean
    Whether it names custom models, whose records share one entity and so take no condition.
    static boolean
    Whether the object names many models — every one, or a package's — rather than one.
    static boolean
    names(String object, ModelRef model)
    Whether the object names the model: as *, by its package, or exactly.
    static void
    requireField(String object, String field)
    Refuses a field the named model does not have, and a name no model answers to: one removed after it was named.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • canonical

      public static String canonical(String name)
      The object as a permission names it, from a name a person or an agent wrote: an entity's simple name becomes its full name.
      Throws:
      IllegalArgumentException - when it names nothing, or several entities share the simple name
    • requireField

      public static void requireField(String object, String field)
      Refuses a field the named model does not have, and a name no model answers to: one removed after it was named.
    • names

      public static boolean names(String object, ModelRef model)
      Whether the object names the model: as *, by its package, or exactly.
    • coversManyModels

      public static boolean coversManyModels(String object)
      Whether the object names many models — every one, or a package's — rather than one.
    • coversCustomModels

      public static boolean coversCustomModels(String object)
      Whether it names custom models, whose records share one entity and so take no condition.