{
  "schemaVersion": "1.0",
  "item": {
    "slug": "authorization",
    "name": "Authorization",
    "source": "tencent",
    "type": "skill",
    "category": "安全合规",
    "sourceUrl": "https://clawhub.ai/ivangdavila/authorization",
    "canonicalUrl": "https://clawhub.ai/ivangdavila/authorization",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/authorization",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=authorization",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "middleware.md",
      "models.md",
      "patterns.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/authorization"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/authorization",
    "agentPageUrl": "https://openagent3.xyz/skills/authorization/agent",
    "manifestUrl": "https://openagent3.xyz/skills/authorization/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/authorization/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "When to Use",
        "body": "User needs to control what actions users can perform. Agent handles permission design, role hierarchies, policy evaluation, and access control middleware."
      },
      {
        "title": "Quick Reference",
        "body": "TopicFileRBAC vs ABAC comparisonmodels.mdImplementation patternspatterns.mdFramework middlewaremiddleware.md"
      },
      {
        "title": "1. Auth ≠ Authorization",
        "body": "Authentication: Who you are (login, OAuth, tokens)\nAuthorization: What you can do (permissions, roles, policies)\nNever mix concerns — auth happens BEFORE authorization"
      },
      {
        "title": "2. Principle of Least Privilege",
        "body": "Default deny — explicit grants only\nUsers get minimum permissions for their job\nAudit permissions periodically (revoke unused)\nTemporary elevation over permanent grants"
      },
      {
        "title": "3. Choose the Right Model",
        "body": "ModelBest ForComplexityACLSimple resource ownershipLowRBACOrganizational hierarchiesMediumABACDynamic context-based rulesHighReBACSocial graphs, sharingHigh\n\nStart simple → evolve when needed."
      },
      {
        "title": "4. Role Design Patterns",
        "body": "Roles represent jobs, not permissions\nMax 3 inheritance levels (admin → manager → user)\nAvoid role explosion — combine with ABAC for edge cases\nDocument role definitions (what can this role DO?)"
      },
      {
        "title": "5. Permission Naming",
        "body": "resource:action:scope\ndocuments:write:own     ← Can edit own documents\ndocuments:write:team    ← Can edit team documents\ndocuments:delete:all    ← Can delete any document\n\nConsistent naming prevents ambiguity."
      },
      {
        "title": "6. Policy Evaluation Order",
        "body": "Explicit deny → always wins\nExplicit allow → checked second\nNo match → default deny\nLog all denials for debugging"
      },
      {
        "title": "7. Never Hardcode",
        "body": "// ❌ Bad — hardcoded role check\nif (user.role === 'admin') { ... }\n\n// ✅ Good — permission check\nif (can(user, 'settings:update')) { ... }\n\nRoles change. Permissions are stable."
      },
      {
        "title": "Common Traps",
        "body": "Checking roles instead of permissions → brittle when roles change\nOR logic in permissions → \"can edit OR is admin\" creates backdoors\nCaching permissions too long → stale grants after role changes\nFrontend-only checks → always verify server-side\nGod roles → split \"admin\" into specific permission sets\nCircular inheritance → A inherits B inherits A crashes system"
      },
      {
        "title": "Security & Privacy",
        "body": "Data that stays local:\n\nAll documentation and patterns are reference material\nNo data collection or external requests\n\nThis skill does NOT:\n\nAccess your codebase automatically\nMake network requests\nStore any user data"
      },
      {
        "title": "Feedback",
        "body": "If useful: clawhub star authorization\nStay updated: clawhub sync"
      }
    ],
    "body": "When to Use\n\nUser needs to control what actions users can perform. Agent handles permission design, role hierarchies, policy evaluation, and access control middleware.\n\nQuick Reference\nTopic\tFile\nRBAC vs ABAC comparison\tmodels.md\nImplementation patterns\tpatterns.md\nFramework middleware\tmiddleware.md\nCore Rules\n1. Auth ≠ Authorization\nAuthentication: Who you are (login, OAuth, tokens)\nAuthorization: What you can do (permissions, roles, policies)\nNever mix concerns — auth happens BEFORE authorization\n2. Principle of Least Privilege\nDefault deny — explicit grants only\nUsers get minimum permissions for their job\nAudit permissions periodically (revoke unused)\nTemporary elevation over permanent grants\n3. Choose the Right Model\nModel\tBest For\tComplexity\nACL\tSimple resource ownership\tLow\nRBAC\tOrganizational hierarchies\tMedium\nABAC\tDynamic context-based rules\tHigh\nReBAC\tSocial graphs, sharing\tHigh\n\nStart simple → evolve when needed.\n\n4. Role Design Patterns\nRoles represent jobs, not permissions\nMax 3 inheritance levels (admin → manager → user)\nAvoid role explosion — combine with ABAC for edge cases\nDocument role definitions (what can this role DO?)\n5. Permission Naming\nresource:action:scope\ndocuments:write:own     ← Can edit own documents\ndocuments:write:team    ← Can edit team documents\ndocuments:delete:all    ← Can delete any document\n\n\nConsistent naming prevents ambiguity.\n\n6. Policy Evaluation Order\nExplicit deny → always wins\nExplicit allow → checked second\nNo match → default deny\nLog all denials for debugging\n7. Never Hardcode\n// ❌ Bad — hardcoded role check\nif (user.role === 'admin') { ... }\n\n// ✅ Good — permission check\nif (can(user, 'settings:update')) { ... }\n\n\nRoles change. Permissions are stable.\n\nCommon Traps\nChecking roles instead of permissions → brittle when roles change\nOR logic in permissions → \"can edit OR is admin\" creates backdoors\nCaching permissions too long → stale grants after role changes\nFrontend-only checks → always verify server-side\nGod roles → split \"admin\" into specific permission sets\nCircular inheritance → A inherits B inherits A crashes system\nSecurity & Privacy\n\nData that stays local:\n\nAll documentation and patterns are reference material\nNo data collection or external requests\n\nThis skill does NOT:\n\nAccess your codebase automatically\nMake network requests\nStore any user data\nFeedback\nIf useful: clawhub star authorization\nStay updated: clawhub sync"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ivangdavila/authorization",
    "publisherUrl": "https://clawhub.ai/ivangdavila/authorization",
    "owner": "ivangdavila",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/authorization",
    "downloadUrl": "https://openagent3.xyz/downloads/authorization",
    "agentUrl": "https://openagent3.xyz/skills/authorization/agent",
    "manifestUrl": "https://openagent3.xyz/skills/authorization/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/authorization/agent.md"
  }
}