No description
Find a file
2024-09-02 22:24:34 +02:00
.github/workflows Merge remote-tracking branch 'origin/master' 2024-09-02 22:24:12 +02:00
.idea 3.0.1 2024-09-02 22:24:34 +02:00
.kotlin/metadata/kotlinTransformedMetadataLibraries Fix for TypeScript declarations 2024-09-02 22:24:02 +02:00
gradle/wrapper First Commit 2024-07-04 21:38:57 +02:00
kotlin-js-store Fix for TypeScript declarations 2024-09-02 22:24:02 +02:00
src 3.0.0 2024-07-19 16:06:04 +02:00
.gitignore Fix for TypeScript declarations 2024-09-02 22:24:02 +02:00
.yarnrc.yml Fix for TypeScript declarations 2024-09-02 22:24:02 +02:00
build.gradle.kts Fix for TypeScript declarations 2024-09-02 22:24:02 +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