Record Class PlatformQueryAccess

java.lang.Object
java.lang.Record
com.axelor.meta.query.PlatformQueryAccess
Record Components:
user - null for a trusted context, which the validator does not check
All Implemented Interfaces:
QueryAccess, SecurityFilters

public record PlatformQueryAccess(User user, QueryAccessValidator validator, SecurityFilters rows) extends Record implements QueryAccess
The platform's permissions for user: model and field checks from QueryAccessValidator, row predicates from rows.
  • Constructor Details

    • PlatformQueryAccess

      public PlatformQueryAccess(User user, QueryAccessValidator validator, SecurityFilters rows)
      Creates an instance of a PlatformQueryAccess record class.
      Parameters:
      user - the value for the user record component
      validator - the value for the validator record component
      rows - the value for the rows record component
  • Method Details

    • checkModelRead

      public void checkModelRead(ResolvedModel model, String target)
      Description copied from interface: QueryAccess
      Refuses reading model.
      Specified by:
      checkModelRead in interface QueryAccess
      Parameters:
      target - how a refusal names what the query reads
    • checkFieldRead

      public void checkFieldRead(ResolvedModel model, String path, String label)
      Description copied from interface: QueryAccess
      Refuses reading path on model, and every model the path passes through.
      Specified by:
      checkFieldRead in interface QueryAccess
      Parameters:
      label - how a refusal names the part of the query that reads it
    • predicate

      public String predicate(Class<? extends Model> model, String alias, Function<Object,String> binder)
      Description copied from interface: SecurityFilters
      Returns an extra JPQL predicate restricting reads of model at alias, with any literal values bound through binder (which returns the :param placeholder), or null if the current user has no row-level filter on the model.
      Specified by:
      predicate in interface SecurityFilters
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • user

      public User user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component
    • validator

      public QueryAccessValidator validator()
      Returns the value of the validator record component.
      Returns:
      the value of the validator record component
    • rows

      public SecurityFilters rows()
      Returns the value of the rows record component.
      Returns:
      the value of the rows record component