/authorization-casl

Manage and share permissions with casl

Primary LanguageTypeScript

React Authorization with Casl Library

Folder structure

📦src
 ┣ 📂components
 ┃ ┣ 📜ProtectedLayout.tsx
 ┃ ┗ 📜withRole.tsx
 ┣ 📂configs
 ┃ ┣ 📜ability.ts
 ┃ ┗ 📜auth.ts
 ┣ 📂context
 ┃ ┣ 📂Ability
 ┃ ┃ ┣ 📜AbilityProvider.tsx
 ┃ ┃ ┗ 📜index.ts
 ┃ ┗ 📂Auth
 ┃ ┃ ┣ 📜AuthProvider.tsx
 ┃ ┃ ┗ 📜index.ts
 ┣ 📂hooks
 ┃ ┣ 📜index.ts
 ┃ ┣ 📜useAbility.ts
 ┃ ┗ 📜useAuth.ts
 ┣ 📂interfaces
 ┃ ┗ 📜auth.ts
 ┣ 📂layouts
 ┃ ┗ 📜MainLayout.tsx
 ┣ 📂pages
 ┃ ┣ 📜Admin.tsx
 ┃ ┣ 📜Editor.tsx
 ┃ ┣ 📜Home.tsx
 ┃ ┣ 📜Login.tsx
 ┃ ┣ 📜NotFound.tsx
 ┃ ┣ 📜Subscriber.tsx
 ┃ ┣ 📜Todo.tsx
 ┃ ┗ 📜Unauthorized.tsx
 ┣ 📜App.css
 ┣ 📜App.tsx
 ┣ 📜index.css
 ┣ 📜main.tsx
 ┗ 📜vite-env.d.ts