syntax = "proto3";

package chatto.api.v1;

// Effective decision for one permission key.
message PermissionGrant {
  // Stable permission key, such as "server.manage".
  string permission = 1;
  // Whether the permission is currently granted.
  bool granted = 2;
}

// Effective decision for one capability key.
//
// Built-in keys currently include:
// - admin.view
// - dm.start
// - admin.view-users
// - user.manage-accounts
// - role.assign
// - role.view
// - role.manage
// - admin.view-system
// - admin.view-audit
// - user.manage-permissions
//
// Clients should ignore unknown keys so servers can add capabilities over time.
message CapabilityGrant {
  // Stable capability key, such as "admin.view" or "dm.start".
  string capability = 1;
  // Whether the capability is currently available.
  bool granted = 2;
}
