aj-geddes avatar

Access Control Rbac

This is a solid foundation for implementing role based access control in your app. You get working examples in Node.js, Python, and Java Spring Security, covering both traditional RBAC and attribute based access control. The code shows permission classes, role hierarchies, and policy evaluation logic you can adapt. Honestly, the examples are educational but you'll need to extend them significantly for production use, especially around persistence, caching, and integration with your auth system. Best suited for teams building their first serious authorization layer or migrating from ad hoc permission checks to something structured. The best practices section is actually useful, emphasizing least privilege and avoiding role explosion.

skills.sh installs
763
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill access-control-rbac --agent claude-code

Installs into .claude/skills of the current project.

Files

Access Control & RBAC

Table of Contents

Overview

Implement comprehensive Role-Based Access Control systems with permissions management, attribute-based policies, and least privilege principles.

When to Use

  • Multi-tenant applications
  • Enterprise access management
  • API authorization
  • Admin dashboards
  • Data access controls
  • Compliance requirements

Quick Start

Minimal working example:

// rbac-system.js
class Permission {
  constructor(resource, action) {
    this.resource = resource;
    this.action = action;
  }

  toString() {
    return `${this.resource}:${this.action}`;
  }
}

class Role {
  constructor(name, description) {
    this.name = name;
    this.description = description;
    this.permissions = new Set();
    this.inherits = new Set();
  }

  addPermission(permission) {
    this.permissions.add(permission.toString());
  }

  removePermission(permission) {
// ... (see reference guides for full implementation)

Reference Guides

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Security, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258

Recommended

More Security
1mindrally avatarauth0-authenticationmindrally/skillsGuidelines for implementing Auth0 authentication with best practices for security, rules, actions, and SDK integration724skills.sh installs
2aj-geddes avatarapi-authenticationaj-geddes/useful-ai-promptsImplement secure API authentication with JWT, OAuth 2.0, API keys, and session management. Use when securing APIs, managing tokens, or implementing user authent612skills.sh installs
3aj-geddes avataroauth-implementationaj-geddes/useful-ai-promptsImplement secure OAuth 2.0, OpenID Connect (OIDC), JWT authentication, and SSO integration. Use when building secure authentication systems for web and mobile a558skills.sh installs
4parcadei avatarsecurityparcadei/continuous-claude-v3Security audit workflow - vulnerability scan → verification532skills.sh installs
5secondsky avatarcsrf-protectionsecondsky/claude-skillsImplements CSRF protection using synchronizer tokens, double-submit cookies, and SameSite attributes. Use when securing web forms, protecting state-changing end474skills.sh installs
6davila7 avatarsecurity-reviewdavila7/claude-code-templatesUse this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provid471skills.sh installs