WorkspaceRole (http/authz.py)

LangBot · src/langbot/pkg/api/http/authz.py · python · Apache-2.0
auth, tag:embed-classified

Defines workspace roles, permissions, and helpers for authorization checks.

# Source: https://github.com/langbot-app/LangBot | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import enum
import types
import typing

from .context import RequestContext


class WorkspaceRole(enum.StrEnum):
    OWNER = 'owner'
    ADMIN = 'admin'
    DEVELOPER = 'developer'
    OPERATOR = 'operator'
    VIEWER = 'viewer'


class Permission(enum.StrEnum):
    WORKSPACE_VIEW = 'workspace.view'
    WORKSPACE_UPDATE = 'workspace.update'
    WORKSPACE_DELETE = 'workspace.delete'
    MEMBER_VIEW = 'member.view'
    MEMBER_INVITE = 'member.invite'
    MEMBER_UPDATE_ROLE = 'member.update_role'
    MEMBER_REMOVE = 'member.remove'
    RESOURCE_VIEW = 'r

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key