Iteração rápida · APIs e docs podem mudar
Liri Liri Docs
Toda a documentação
PT

A documentação está disponível apenas em inglês no momento.

This page is synced from app/docs/配置与安全/permissions.md in the GitHub repository. If it differs from the source, the repository wins.

Permission System

Overview

The permission system controls how users and tools access system resources.

Permission Hierarchy

User → Role → Permission
         ↓
      Policy

Built-in Roles

RoleDescription
adminAdministrator, full access
userRegular user, basic access
readonlyRead-only user, read operations only

Permission Definitions

type Permission =
  | "file:read"
  | "file:write"
  | "bash:exec"
  | "network:fetch"
  | "network:search"
  | "admin:config";

Policy Configuration

{
  "permissions": {
    "file_read": {
      "allowed": true,
      "paths": ["./src", "./config"],
      "excludedPaths": ["./config/secrets.json"]
    },
    "bash_exec": {
      "allowed": true,
      "commands": ["node", "bun", "git"],
      "forbiddenCommands": ["rm", "del", "format"]
    }
  }
}

Path Validation

  • Every file operation verifies that the path falls within the allowed scope
  • Path traversal attacks are prevented through path resolution (path.resolve)
  • Operating system critical paths are forbidden

Arquivo de origem: app/docs/配置与安全/permissions.md