diff --git a/.cursor/rules/security-patterns.mdc b/.cursor/rules/security-patterns.mdc index 104dbd71b..a7ab2ad69 100644 --- a/.cursor/rules/security-patterns.mdc +++ b/.cursor/rules/security-patterns.mdc @@ -227,6 +227,159 @@ public function __construct( - New authorization parameters are optional - Legacy @can/@else patterns still function but are discouraged +### Custom Component Authorization Patterns + +When dealing with **custom Alpine.js components** or complex UI elements that don't use the standard `x-forms.*` components, manual authorization protection is required since the automatic `canGate` system only applies to enhanced form components. + +#### Common Custom Components Requiring Manual Protection + +**⚠️ Custom Components That Need Manual Authorization:** +- Custom dropdowns/selects with Alpine.js +- Complex form widgets with JavaScript interactions +- Multi-step wizards or dynamic forms +- Third-party component integrations +- Custom date/time pickers +- File upload components with drag-and-drop + +#### Manual Authorization Pattern + +**✅ Proper Manual Authorization:** +```html + +
File upload restricted
+ @if($currentFile) +Current: {{ $currentFile }}
+ @endif +