Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Access Control Rbac

  • 625 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

access-control-rbac is a Claude Code skill that helps developers wire Spring Security HTTP rules and method security so Java REST APIs enforce roles and fine-grained permissions.

About

access-control-rbac is a Java Spring Security skill for developers implementing role-based access control on REST APIs. The skill provides RBACConfiguration patterns using SecurityFilterChain, HttpSecurity path matchers, and @EnableGlobalMethodSecurity with prePostEnabled for @PreAuthorize method guards. Developers reach for access-control-rbac when endpoints must restrict access by role—admin versus user—and when fine-grained permissions must apply at both URL and method levels. Example code covers filter chain setup, HTTP authorization rules, and annotation-driven method security for production Spring Boot services.

  • Spring `SecurityFilterChain` with public, role (`hasRole`), and authority (`hasAuthority`) matchers
  • Separate path patterns for admin, users, and CRUD-style post endpoints
  • `@EnableGlobalMethodSecurity(prePostEnabled = true)` for method-level RBAC
  • Copy-paste Java package layout (`com.example.security.RBACConfiguration`)
  • Authenticated default with explicit permit-all for `/api/public/**`

Access Control Rbac by the numbers

  • 625 all-time installs (skills.sh)
  • Ranked #473 of 2,203 Security skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill access-control-rbac

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs625
repo stars305
Security audit3 / 3 scanners passed
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you implement RBAC in Spring Security?

Wire Spring Security HTTP rules and method security so REST APIs enforce roles and fine-grained permissions.

Who is it for?

Java backend developers securing Spring Boot REST APIs with role-based and method-level permission enforcement.

Skip if: Non-Spring stacks, frontend-only auth UI work, or OAuth provider setup without server-side authorization rule configuration.

When should I use this skill?

The user implements Spring Security RBAC, HttpSecurity path rules, or @PreAuthorize method permissions on Java REST APIs.

What you get

RBACConfiguration.java, HttpSecurity authorization rules, and method-level @PreAuthorize permission annotations.

  • RBACConfiguration.java
  • HttpSecurity authorization rules
  • Method security annotations

Files

SKILL.mdMarkdownGitHub ↗

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

Detailed implementations in the references/ directory:

GuideContents
Node.js RBAC SystemNode.js RBAC System
Python ABAC (Attribute-Based Access Control)Python ABAC (Attribute-Based Access Control)
Java Spring Security RBACJava Spring Security RBAC

Best Practices

✅ DO

  • Implement least privilege
  • Use role hierarchies
  • Audit access changes
  • Regular access reviews
  • Separate duties
  • Document permissions
  • Test access controls
  • Use attribute-based policies

❌ DON'T

  • Grant excessive permissions
  • Share accounts
  • Skip access reviews
  • Hardcode permissions
  • Ignore audit logs
  • Use role explosion

Related skills

FAQ

What Spring components does access-control-rbac configure?

access-control-rbac configures SecurityFilterChain and HttpSecurity for URL authorization plus @EnableGlobalMethodSecurity with @PreAuthorize for method-level RBAC on Java REST APIs.

Does access-control-rbac cover method-level permissions?

access-control-rbac covers both HTTP path rules and fine-grained method security via @PreAuthorize annotations, enabling role and permission checks at the controller and service layer.

Is Access Control Rbac safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Securityappsec

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.