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 Type
    Method
    Description
    Enabled non-internal agents visible to the user, ordered by sortOrder, name.
    boolean
    canAccessAgent(User user, AiAgent agent)
    True iff the user may chat with the given agent.
    boolean
    True iff the user can open the chat UI — i.e.
    boolean
    True iff the user is considered an AI administrator.
    The user's default agent: the agent flagged isDefault=true if it is accessible, else the first accessible agent, else null.
  • Method Details

    • isAiAdmin

      boolean isAiAdmin(User user)
      True iff the user is considered an AI administrator.
    • hasAnyAiAccess

      boolean hasAnyAiAccess(User user)
      True iff the user can open the chat UI — i.e. admin, or has at least one role referenced by an enabled AiAgent.
    • canAccessAgent

      boolean canAccessAgent(User user, AiAgent agent)
      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

      List<AiAgent> availableAgents(User user)
      Enabled non-internal agents visible to the user, ordered by sortOrder, name.
    • resolveDefaultAgent

      AiAgent resolveDefaultAgent(User user)
      The user's default agent: the agent flagged isDefault=true if it is accessible, else the first accessible agent, else null.