.cursor/skills/nazim-permissions/SKILL.md
Spatie permission patterns for Nazim main app. Use when adding permissions, menu visibility, or backend permission checks. Covers permission name format, useHasPermission, useUserPermissions, no role fallbacks.
npx skillsauth add AHMADJAN-New/nazim-web nazim-permissionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The app uses Spatie Laravel Permission with organization scoping. Use permission checks only — not profiles.role or role-based fallbacks.
{resource}.{action} — no prefixesclasses.read, subjects.create, timetables.read, schedule_slots.update, exams.readacademic.classes.read, academic.subjects.createresource='classes' for name='classes.read')!!profile?.organization_id && !orgsLoading — use organization_id, NOT role['user-permissions', profile?.organization_id, profile?.default_school_id ?? null, profile?.id, orgIds.join(',')]profiles.role is deprecated; roles come from Spatie model_has_roles@/hooks/usePermissions (useUserPermissions, useHasPermission)Use for menu and feature visibility:
const hasBuildingsPermission = useHasPermission('buildings.read');
// Only show if user has permission
...(hasBuildingsPermission ? [{ title: "Buildings Management", url: "/settings/buildings", icon: Building2 }] : []),
useHasPermission('resource.action') for all visibilityisSuperAdmin || role === 'admin' checks$user->hasPermissionTo('resource.action'); organization context is set by EnsureOrganizationAccess middleware (setPermissionsTeamId).organization_id = NULL; organization-specific with organization_id = UUID.role_has_permissions; per-user overrides via model_has_permissions (Spatie checks direct first, then role).resource.action (no prefix)useHasPermission(), not roleorganization_id, not rolehasPermissionTo('resource.action')tools
Toast notifications for Nazim. Use when showing success/error/info messages. ALWAYS use showToast from @/lib/toast with translation keys; never toast from sonner directly. RTL positioning is automatic.
tools
Enforces status badge patterns for Nazim UI. Use when displaying status in tables, cards, or dialogs. Covers Badge variants, semantic colors, statusBadgeVariant, statusOptions with color.
development
Enforces mobile-first responsive patterns for Nazim UI. Use when building pages, tables, forms, charts, or buttons. Covers page container, FilterPanel, tabs, grids, tables, charts, cards, buttons.
development
PDF and Excel report generation for Nazim. Use when adding or changing reports. Backend uses ReportService and ReportConfig; frontend uses useServerReport. Covers branding, DateConversionService, RTL, acceptance criteria.