smithery/valec3

backend-security-authorization

RBAC, permissions, access control.

Installation

$ npx skills add smithery/valec3 --skill backend-security-authorization

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,378 B
  • docs SUMMARY.md 72 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend Security Authorization

When to use this skill

  • Role-based access control
  • Permission systems
  • Resource authorization
  • Policy enforcement

Workflow

  • Define roles and permissions
  • Check permissions before actions
  • Use middleware for routes
  • Implement policies
  • Deny by default

Instructions

RBAC Structure

<?php

enum Role: string
{
    case ADMIN = 'admin';
    case USER = 'user';
    case GUEST = 'guest';
}

class User extends Entity
{
    public function hasRole(Role $role): bool
    {
        return $this->role === $role->value;
    }

    public function can(string $permission): bool
    {
        return in_array($permission, $this->permissions ?? []);
    }
}

Authorization Filter

<?php

class PermissionFilter implements FilterInterface
{
    public function before(RequestInterface $request, $arguments = null)
    {
        $permission = $arguments[0] ?? null;
        $user = auth()->user();

        if (!$user || !$user->can($permission)) {
            return Services::response()
                ->setJSON(['error' => 'Forbidden'])
                ->setStatusCode(403);
        }
    }
}

Resources

  • Check permissions, not roles
  • Use filters for route protection
  • Deny by default