Member Junction
    Preparing search index...

    Helper class for managing AI Agent permissions. Provides methods to check user permissions, get accessible agents, and uses AIEngineBase cached metadata.

    Index

    Constructors

    Methods

    • Gets all agents that a user has access to with a specific permission level. Uses cached metadata from AIEngineBase instead of querying database.

      Parameters

      • user: UserInfo

        The user to check permissions for

      • permission: "view" | "run" | "edit" | "delete"

        The minimum permission level required ('view', 'run', 'edit', or 'delete')

      Returns Promise<MJAIAgentEntity[]>

      Array of agents the user can access with the specified permission

    • Gets the aggregate permissions for a user on a specific agent. Implements hierarchical permission logic:

      • Delete implies Edit, Run, and View
      • Edit implies Run and View
      • Run implies View

      Default behavior when no permission records exist:

      • Anyone can View and Run (open by default)
      • Only owner can Edit and Delete

      Checks ownership first, then combines all matching user and role permissions.

      Parameters

      • agentId: string

        The ID of the agent

      • user: UserInfo

        The user to check permissions for

      Returns Promise<EffectiveAgentPermissions>

      Object containing all effective permissions and ownership status

    • Checks if a user has a specific permission for an agent.

      Parameters

      • agentId: string

        The ID of the agent to check

      • user: UserInfo

        The user to check permissions for

      • permission: "view" | "run" | "edit" | "delete"

        The permission level to check ('view', 'run', 'edit', or 'delete')

      Returns Promise<boolean>

      True if the user has the specified permission