Skip to content

Expose grant/revoke agent access as abilities #537

Description

@chubes4

Context

The Data Machine admin manages per-user agent access grants through WP_Agent_Access_Store (grant_access, revoke_access, get_users_for_agent). As part of retiring Data Machine's datamachine/v1 product API (#3456), we audited agents-api's ability surface (src/Auth/register-agent-access-abilities.php) and found it exposes only the read side: agents/can-access-agent and agents/list-accessible-agents.

There is no ability surface for grant/revoke/list-for-agent, so Data Machine had to keep that logic plugin-side.

Interim

We added a single Data Machine ability, datamachine/manage-agent-access (action: list|grant|revoke, manage_agents permission, show_in_rest: true), wrapping our AgentAccess repository directly: Extra-Chill/data-machine#3473 (part of Extra-Chill/data-machine#3456)

Request

Expose grant/revoke (and list-grants-for-agent) as first-class agents-api abilities so consumers stop reaching into the access store directly:

  • agents/grant-agent-access — grant a principal access to an agent at a role
  • agents/revoke-agent-access — revoke a principal's access
  • agents/list-agent-access — list grants for an agent (the inverse of agents/list-accessible-agents, which lists agents for a principal)

Ownership-protection rules (e.g. "cannot revoke the owner's grant") feel like substrate policy and would benefit from living upstream next to the store rather than being re-implemented per consumer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions