Access Control and RBAC

Access Control and RBAC

Teaches a coding agent to implement role-based and attribute-based access control with fine-grained permissions in Node.js, Python and Spring Security.

Skill files5 files

references/

scripts/

SKILL.md96 lines
1
---
2
name: access-control-rbac
3
description: >
4
Implement Role-Based Access Control (RBAC), permissions management, and
5
authorization policies. Use when building secure access control systems with
6
fine-grained permissions.
7
---
8
9
# Access Control & RBAC
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement comprehensive Role-Based Access Control systems with permissions management, attribute-based policies, and least privilege principles.
22
23
## When to Use
24
25
- Multi-tenant applications
26
- Enterprise access management
27
- API authorization
28
- Admin dashboards
29
- Data access controls
30
- Compliance requirements
31
32
## Quick Start
33
34
Minimal working example:
35
36
```javascript
37
// rbac-system.js
38
class Permission {
39
constructor(resource, action) {
40
this.resource = resource;
41
this.action = action;
42
}
43
44
toString() {
45
return `${this.resource}:${this.action}`;
46
}
47
}
48
49
class Role {
50
constructor(name, description) {
51
this.name = name;
52
this.description = description;
53
this.permissions = new Set();
54
this.inherits = new Set();
55
}
56
57
addPermission(permission) {
58
this.permissions.add(permission.toString());
59
}
60
61
removePermission(permission) {
62
// ... (see reference guides for full implementation)
63
```
64
65
## Reference Guides
66
67
Detailed implementations in the `references/` directory:
68
69
| Guide | Contents |
70
|---|---|
71
| [Node.js RBAC System](references/nodejs-rbac-system.md) | Node.js RBAC System |
72
| [Python ABAC (Attribute-Based Access Control)](references/python-abac-attribute-based-access-control.md) | Python ABAC (Attribute-Based Access Control) |
73
| [Java Spring Security RBAC](references/java-spring-security-rbac.md) | Java Spring Security RBAC |
74
75
## Best Practices
76
77
### ✅ DO
78
79
- Implement least privilege
80
- Use role hierarchies
81
- Audit access changes
82
- Regular access reviews
83
- Separate duties
84
- Document permissions
85
- Test access controls
86
- Use attribute-based policies
87
88
### ❌ DON'T
89
90
- Grant excessive permissions
91
- Share accounts
92
- Skip access reviews
93
- Hardcode permissions
94
- Ignore audit logs
95
- Use role explosion
96

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,350 prompts

More by @OpenSourceBuffGuy

See all
Night megacity evacuation as alien structure arrives prompt image

Night megacity evacuation as alien structure arrives

Generates a 45-second sci-fi thriller about a survivor fleeing a rainy megacity as a huge alien structure arrives, with a beat sheet and continuity lock.

video-prompt, sci-fi, cinematic, photorealistic, timed-beats, multi-shot, trailer, character-consistency, negative-prompt, guardrails, futuristic, night-scene, rain, cityscape, woman, aerial-view, dramatic-lighting, camera-movement, spaceships, visual-effects, seedance, for-filmmakers, long-form, structured-output, neon

Black luxury sedan city ad ending with a kiss prompt image

Black luxury sedan city ad ending with a kiss

Generates a 15-second photorealistic luxury car commercial in four timed shots through a dusk city, ending with the driver blowing a kiss.

video-prompt, video-ad, multi-shot, timed-beats, cars, camera-movement, tracking-shot, photorealistic, cinematic, cityscape, luxury, low-angle, product-video, bokeh, night-scene, for-filmmakers, for-marketers, advertising, negative-prompt, hailuo, long-form, woman

3D cartoon boy stepping out of a sketchbook drawing prompt image

3D cartoon boy stepping out of a sketchbook drawing

Draws a cute 3D cartoon boy stepping out of a pencil-sketch page of a sketchbook on a wooden desk, lit by warm fairy lights.

image-prompt, 3d-render, pixar-style, cartoon, character-design, cozy, bokeh, surreal, whimsical, soft-lighting, studio-lighting, still-life, illustration, sketch, nano-banana, quick, text-rendering, cinematic

Reviews

Loading reviews…

Discussion

Loading comments…