Package com.axelor.ai
Interface AiPermissionService
- All Known Implementing Classes:
AiPermissionServiceImpl
public interface AiPermissionService
Role-based access resolver for the AI module: who may use the assistant, and with which agents.
Agent visibility is controlled by the agent's roles, groups and users.
All methods short-circuit for admins (login admin, group admins, or role
ai-admin): full agent access.
-
Method Summary
Modifier and TypeMethodDescriptionavailableAgents(User user) Enabled non-internal agents visible to the user, ordered bysortOrder, name.booleancanAccessAgent(User user, AiAgent agent) True iff the user may chat with the given agent.booleanhasAnyAiAccess(User user) True iff the user can open the chat UI — i.e.booleanTrue iff the user is considered an AI administrator.resolveDefaultAgent(User user) The user's default agent: the agent flaggedisDefault=trueif it is accessible, else the first accessible agent, elsenull.
-
Method Details
-
isAiAdmin
True iff the user is considered an AI administrator. -
hasAnyAiAccess
True iff the user can open the chat UI — i.e. admin, or has at least one role referenced by an enabledAiAgent. -
canAccessAgent
True iff the user may chat with the given agent. Admins always pass. For non-admins, the agent must have at least one role in common with the user's direct or group roles; an agent with no roles assigned is inaccessible to non-admins. -
availableAgents
Enabled non-internal agents visible to the user, ordered bysortOrder, name. -
resolveDefaultAgent
The user's default agent: the agent flaggedisDefault=trueif it is accessible, else the first accessible agent, elsenull.
-