Class Projection

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

public final class Projection extends Object
The one way the AI reads a record: what it asks for, refused when the user may not read it, and what comes along unasked — a name field, a relation's name — withheld with a marker.

A withheld value is listed under HIDDEN on the map that would have held it, so the agent knows something is there and does not take the gap for "no data". $ cannot start a field name, so the key never collides with one.

  • Field Details

  • Constructor Details

    • Projection

      public Projection(Access access)
  • Method Details

    • readDenial

      public String readDenial(ModelRef model, Collection<String> fields)
      The refusal for asked-for fields the user may not read, naming every one of them; null when all are readable. Names the model does not have are the caller's to refuse first: a typo is not a denial.
    • readable

      public List<String> readable(ModelRef model, Collection<String> names)
      The names among names the user may read, for a message that lists a model's fields.
    • record

      public Map<String,Object> record(Model record, List<String> fields)
      A record's id, version and the asked-for fields, which readDenial(com.axelor.ai.governance.access.ModelRef, java.util.Collection<java.lang.String>) has cleared; with none asked, its name field, withheld when unreadable. Relations are flattened (relation(com.axelor.db.Model)), collections item by item.
    • record

      public Map<String,Object> record(MetaJsonRecord record, MetaJsonModel jsonModel, List<String> fields)
      The same for a custom model's record.
    • relation

      public Map<String,Object> relation(Model related)
      A related record, as the agent sees it: {id, <name field>}; the name withheld when the user may not read it; {id} alone when they may not read the related record — its model, or the row, which a permission's condition may exclude — the id being the parent's own column.
    • screen

      public Map<String,Object> screen(ModelRef model, Map<String,Object> values)
      Form values as the user may read them: what a form holds, loaded or edited, or what a run of it changed. A field they may not read is left out, its display keys (status$value) with it, and listed under HIDDEN. A relation's values are screened against the model it points at, and are the id alone when the user may not read that model. A key that names no field of the model — a dummy, a bookkeeping key — is kept: it stores nothing, and nothing restricts it.
    • hide

      public static void hide(Map<String,Object> map, String field)
      Lists field under HIDDEN on map.