Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Roles

A role is a named set of permissions, such as an editor who may view and edit reports. Your config defines the roles, and a principal holds one in a project, a workspace, or on one resource. Access checks look through the roles a principal holds to decide whether it may take an action.

Resource types and permissions

Your config lists your product’s resource types and each one’s actions, such as a report that can be viewed, edited, shared, and exported. A permission names one action on one type, as <resourceType>:<action>, such as report:edit. An action may be dotted, such as comments.delete.

A role’s permission may be a wildcard:

Permission Covers
report:edit That one action
report:* Every action on report
report:comments.* Every dotted action under comments, such as report:comments.delete
*:* Every action on every type, IdentityHound’s own identity.* types too

A permission must name a type and action the config knows, or the config answers config_invalid. Delegations has its own rules for the permissions a principal may delegate.

IdentityHound guards its own operations with the same model, through built-in resource types such as identity.member and identity.invitation. A role you define may grant their permissions, such as identity.member:add; the types themselves are fixed.

Where a role is held

A role’s scope says where it can be assigned; Access checks explains the order roles are tried in:

  • Project roles apply across the whole project, such as your own support staff. They sit on the principal, in projectRoles, and only your server assigns or removes them.
  • Workspace roles apply to every resource in one workspace. A principal holds one through its membership, as Workspaces describes.
  • Resource roles apply to one resource, such as an editor of one report. One is held by a principal, by every guest, or by every principal that is not a guest. It may expire. Someone with identity.resource_role:assign in the resource’s workspace assigns it; for a resource with no workspace, only your server does.

A role’s optional assignableTo says who may hold it: principal, every principal that is not a guest, guest, or both. Without the list, a role is open to every principal that is not a guest. The list treats every declared kind alike, so a config whose list names human, agent, or service answers config_invalid.

The owner role

Every project has the built-in workspace role owner. Its built-in permissions are fixed, and your config can’t redefine or remove the role. roles.owner.permissions adds permissions to it, such as on your product’s resources; left out, it adds none.

The owner role grants every built-in permission for managing its workspace, members, invitations, and resource roles, plus permission to view its grants. IdentityHound also keeps these promises about owners:

  • Any principal that is not a guest may hold it.
  • An active workspace keeps at least one active owner membership.
  • Only an owner or your server can assign the owner role, change or remove an owner membership, or create an invitation to be an owner.
  • The principal that creates a workspace owns it.

The roles a project starts with

When your project adopts IdentityHound, Agentpost supplies its starting config, including two workspace roles with no assignableTo, so any principal that is not a guest may hold them. They are ordinary roles your config owns: change their names, permissions, and who may hold them, or remove them, as you would any role you define.

Role Permissions
admin identity.workspace:view, identity.member:*, identity.invitation:*, identity.resource_role:*, identity.grant:view
member identity.workspace:view, identity.member:view, identity.invitation:view

With these, an admin views the workspace and grants, manages resource roles and invitations, and manages members who are not owners. Only an owner or your server issues an owner invitation. A member views the workspace, its members, and its invitations.

To remove the member role’s access to the member and invitation lists, remove identity.member:view and identity.invitation:view from member.permissions. In a full config update, roles: {} keeps only the built-in owner permissions.

Removing a role from the config leaves its memberships and invitations in place. A membership with that role grants nothing while the role is absent. Adding a member, issuing or accepting an invitation, or importing a new membership with an undefined role answers role_not_assignable.

The config holds them

Resource types, roles, and the entitlements an action needs all live in the project’s one config. To change a role, read the config, edit its roles, and send the whole config back. Keep the built-in owner details as read and edit roles.owner.permissions to change the permissions you add to it.

Where to act on it