13 lines
282 B
TypeScript
13 lines
282 B
TypeScript
export function __can__(path: string[]) {
|
|
const key = path.join('.')
|
|
const allowed = new Set([
|
|
'employee.view',
|
|
'employee.edit',
|
|
'contract.create',
|
|
])
|
|
|
|
const granted = allowed.has(key)
|
|
console.log('Checking permission:', key, '->', granted)
|
|
return granted
|
|
}
|