initial commit

This commit is contained in:
Inshal
2024-10-25 01:02:11 +05:00
commit 6e65bc3a62
1710 changed files with 273609 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import { Ability } from '@casl/ability'
export const AppAbility = Ability

View File

@@ -0,0 +1,16 @@
import { Ability } from '@casl/ability'
export const initialAbility = [
{
action: 'read',
subject: 'Auth',
},
]
// Read ability from localStorage
// 👉 Handles auto fetching previous abilities if already logged in user
// You can update this if you store user abilities to more secure place
// ❗ Anyone can update localStorage so be careful and please update this
const stringifiedUserAbilities = localStorage.getItem('userAbilities')
const existingAbility = stringifiedUserAbilities ? JSON.parse(stringifiedUserAbilities) : null
export default new Ability(existingAbility || initialAbility)

View File

@@ -0,0 +1,3 @@
import { useAbility } from '@casl/vue'
export const useAppAbility = () => useAbility()