Class Access
Three things decide, and each must allow: the platform's permissions, the permissions of every
agent on the call's chain, and the restrictions in force — the last two read from AiRules. An access made for platform() has no agent and holds to the platform alone,
for what a user configures rather than what an agent reads.
The platform's permission records decide, never view attributes. Model and record access are
the platform's own (JpaSecurity), administrators exempt. Field access reads a field
rule's canRead/canWrite flag as QueryAccessValidator does, with no
administrator exemption; its hideIf/readonlyIf are view attributes and are not
read. A custom field is readable unless it names roles the user lacks, and writable exactly when
readable.
With no user nothing is permitted: an AI call always runs as someone. Nothing here catches a failure; a check that throws fails the call rather than letting it through or quietly refusing.
Built per call, so the answers it memoises cannot outlive a change to the user's rights.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA field whose value a call handed to the model.static enumWho refuses a field: the user's own permissions, or the AI's. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the call may read a field: a property, a custom field, or a custom model's field.booleanWhether the call may write a field, to create or to update.Where this access sends what it reads: the model it is for, and its provider.static AccessforIndexing(Destination destination) What may be sent todestinationwhen nobody asks: a record knowledge source's text, sent to the embedding model when it is indexed.booleanmayReceive(ModelRef model, String field) Whether the field's value may go to this access's destination for its agents, by their permissions and the restrictions alone, not the user's own permissions: for data already in a chat, which another member's turn may send on.booleanmayReceivePath(Class<? extends Model> entity, String path) mayReceive(com.axelor.ai.governance.access.ModelRef, java.lang.String)for every field along a dotted path on an entity.modelDenial(ModelRef model, Operation operation) The refusal foroperationon the model as a whole, or null when it is permitted.static AccessWhat the agent may do for the current user, on the model it is served by.static AccessWhat the last agent on the chain may do for the current user, a sub-agent held to the reach of every agent that consulted it, on the model the last one is served by.static Accessof(List<AiAgent> chain, Destination destination) The same, with what the call reads going todestination.static AccessWhat the agents on the path may do for the current user: their codes, from the root, as a request carries them, on the model the last one is served by.static AccessThe same, on the model the user chose for the turn when there is one.static AccessofRequest(ChatRequest request) What a request's turn may do: its agents', on the model serving it.pathDenial(Class<? extends Model> entity, String path) The refusal for reading a dotted path on an entity, or null when every field along it, and every model it enters, may be read.static Accessplatform()The current user's own access, with no agent: for what the user configures or sees in the application — a knowledge base they may use, a chat's subject in their list — never for what an agent reads.The query engine's view of this access: the platform's checks, and the AI layer's on every model, field and row a query reads.voidNotes that a field's value is handed to the model.readable(ModelRef model, Collection<Long> ids) The records amongidsthe user may read, asrecord(com.axelor.ai.governance.access.ModelRef, com.axelor.ai.governance.access.Operation, java.lang.Long)decides for each, in one query: for a page of related records, where a query each would be one per record.voidNotes every field along a dotted path on an entity: each one's value is handed over.reads()The fields whose values the call handed over.receivableRows(ModelRef model) The rows whose values may go to this access's destination, by the restrictions' conditions alone; null when no condition limits them.Whetheroperationis permitted on one record, which the caller has found: an unconditional permission grants any id, one that names no record included.recordsDenial(ModelRef model, Operation operation, Collection<Long> ids) The refusal for the operation on recordsrecord(com.axelor.ai.governance.access.ModelRef, com.axelor.ai.governance.access.Operation, java.lang.Long)did not grant it on: the user's, when their own permissions refuse it on any of them, else the assistant's.Who refuses the call reading or writing a field, or null when nobody does: the user's own permissions, so a refusal says they may not, or only the AI's, so it says the assistant may not.The row-level read filter for the model, for a tool to combine with its own query: null when no row is excluded.What the agents' permissions and the restrictions in force were read from: equal while none changed, so a caller that checked once may skip asking again.user()The user the call runs as, or null when there is none and nothing is permitted.
-
Method Details
-
of
What the agent may do for the current user, on the model it is served by. -
of
What the last agent on the chain may do for the current user, a sub-agent held to the reach of every agent that consulted it, on the model the last one is served by. An empty chain, or a null on it, reaches nothing. -
of
The same, with what the call reads going todestination. -
ofPath
What the agents on the path may do for the current user: their codes, from the root, as a request carries them, on the model the last one is served by. A code no agent has reaches nothing. -
ofPath
The same, on the model the user chose for the turn when there is one.- Parameters:
chosen- the code of the model the request names, or null
-
ofRequest
What a request's turn may do: its agents', on the model serving it. -
platform
The current user's own access, with no agent: for what the user configures or sees in the application — a knowledge base they may use, a chat's subject in their list — never for what an agent reads. -
forIndexing
What may be sent todestinationwhen nobody asks: a record knowledge source's text, sent to the embedding model when it is indexed. Only the global policies and those listing the destination apply — there is no agent to match the others — and onlymayReceive(com.axelor.ai.governance.access.ModelRef, java.lang.String)answers. -
read
Notes that a field's value is handed to the model. A chat keeps what entered it, and every later call in it sends that again: each must be allowed to receive it (mayReceive(com.axelor.ai.governance.access.ModelRef, java.lang.String)). -
readPath
Notes every field along a dotted path on an entity: each one's value is handed over. -
destination
Where this access sends what it reads: the model it is for, and its provider. -
rulesStamp
What the agents' permissions and the restrictions in force were read from: equal while none changed, so a caller that checked once may skip asking again. -
receivableRows
The rows whose values may go to this access's destination, by the restrictions' conditions alone; null when no condition limits them. For an indexing access, a condition that needs a user to evaluate covers every row. -
mayReceivePath
mayReceive(com.axelor.ai.governance.access.ModelRef, java.lang.String)for every field along a dotted path on an entity. -
reads
The fields whose values the call handed over. -
mayReceive
Whether the field's value may go to this access's destination for its agents, by their permissions and the restrictions alone, not the user's own permissions: for data already in a chat, which another member's turn may send on. -
user
The user the call runs as, or null when there is none and nothing is permitted. -
modelDenial
The refusal foroperationon the model as a whole, or null when it is permitted. -
record
Whetheroperationis permitted on one record, which the caller has found: an unconditional permission grants any id, one that names no record included.The model check does not answer this: a permission whose access is conditional passes it, deciding row by row being what the condition is for. A record the user cannot even read is
RecordAccess.INVISIBLErather than denied, so it is reported as an ID that does not exist would be: a denial would confirm that this one does. -
recordsDenial
The refusal for the operation on recordsrecord(com.axelor.ai.governance.access.ModelRef, com.axelor.ai.governance.access.Operation, java.lang.Long)did not grant it on: the user's, when their own permissions refuse it on any of them, else the assistant's. -
readable
The records amongidsthe user may read, asrecord(com.axelor.ai.governance.access.ModelRef, com.axelor.ai.governance.access.Operation, java.lang.Long)decides for each, in one query: for a page of related records, where a query each would be one per record. -
rowFilter
The row-level read filter for the model, for a tool to combine with its own query: null when no row is excluded. With no user, every row is. -
canRead
Whether the call may read a field: a property, a custom field, or a custom model's field. -
canWrite
Whether the call may write a field, to create or to update. -
refuser
Who refuses the call reading or writing a field, or null when nobody does: the user's own permissions, so a refusal says they may not, or only the AI's, so it says the assistant may not. -
pathDenial
The refusal for reading a dotted path on an entity, or null when every field along it, and every model it enters, may be read. A custom field ends a path.A copy of
QueryAccessValidator.checkFieldRead's walk, answering instead of throwing; unify the two once this API is stable. -
queryAccess
The query engine's view of this access: the platform's checks, and the AI layer's on every model, field and row a query reads.
-