No description
Find a file
2024-07-19 16:35:48 +02:00
.github/workflows Update publish.yml 2024-07-19 16:31:28 +02:00
.idea 3.0.0 2024-07-19 16:06:04 +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 3.0.0 2024-07-19 16:06:04 +02:00
.gitignore First Commit 2024-07-04 21:38:57 +02:00
build.gradle.kts Removed OSSRH 2024-07-19 16:35:43 +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