No description
Find a file
2024-07-06 17:04:24 +02:00
.idea Fixes for js 2024-07-05 00:06:30 +02:00
.kotlin/metadata/kotlinTransformedMetadataLibraries First Commit 2024-07-04 21:38:57 +02:00
gradle/wrapper First Commit 2024-07-04 21:38:57 +02:00
kotlin-js-store First Commit 2024-07-04 21:38:57 +02:00
src Fixes 2024-07-06 17:00:13 +02:00
.gitignore First Commit 2024-07-04 21:38:57 +02:00
build.gradle.kts Fixes 2024-07-06 17:04:24 +02:00
gradle.properties First Commit 2024-07-04 21:38:57 +02:00
gradlew First Commit 2024-07-04 21:38:57 +02:00
gradlew.bat First Commit 2024-07-04 21:38:57 +02:00
README.md . 2024-07-04 21:41:53 +02:00
settings.gradle.kts . 2024-07-04 22:03:54 +02:00

Permission Checker

/!\ We haven't tested this package yet.

checklist

import { checkList } from "permission-checker";

console.log(checkList(["permission1", "permission2.subPermission1"], ["requiredPermission1"]))
// permission1 != requiredPermission1 && permission2.subPermission1 != requiredPermission1, checkList = false
console.log(checkList(["*"], ["requiredPermission1"]))
// * catch all, always true
console.log(checkList(["permission1"], ["*"]))
// if in the first array there isn't * this is always false

console.log(checkList(["permission1"], ["permission1.subPermission1"]))
// permission1 includes subPermission1, this is true

checksingle

is the same of checklist but without an array.

import { checkSingle } from "permission-checker";
console.log(checkSingle("*", "permission1")) // true