"""Workspace-scoped permission codenames."""

from __future__ import annotations

from simorgh.apps.iam.registry import register_permission


def register_all() -> None:
    register_permission(
        "workspaces.workspace.view",
        label="View workspaces",
        description="See workspaces the actor belongs to.",
    )
    register_permission(
        "workspaces.workspace.manage",
        label="Manage workspaces",
        description="Create, update, archive workspaces.",
    )
    register_permission(
        "workspaces.navigation.manage",
        label="Manage workspace navigation",
        description="Edit the navigation tree of a workspace.",
    )
    register_permission(
        "workspaces.member.manage",
        label="Manage workspace members",
        description="Add or remove members of a workspace.",
    )
    register_permission(
        "search.search.run",
        label="Run unified search",
        description="Issue queries against the cross-module search endpoint.",
    )
    register_permission(
        "workspaces.access_grant.manage",
        label="Manage workspace access grants",
        description="Add or remove role→workspace access grants on a workspace.",
    )
