.
This commit is contained in:
parent
c5fdf2895a
commit
fa6b18b599
2 changed files with 30 additions and 3 deletions
27
README.md
Normal file
27
README.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# Permission Checker
|
||||||
|
|
||||||
|
/!\ We haven't tested this package yet.
|
||||||
|
|
||||||
|
## checklist
|
||||||
|
|
||||||
|
```ts
|
||||||
|
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.
|
||||||
|
```ts
|
||||||
|
import { checkSingle } from "permission-checker";
|
||||||
|
console.log(checkSingle("*", "permission1")) // true
|
||||||
|
```
|
|
@ -62,10 +62,10 @@ publishing {
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url = uri("https://path/to/your/maven/repository") // Replace with your Maven repository URL
|
url = uri("https://source.thundernetwork.org/api/packages/ThunderNetworkRaD/maven") // Replace with your Maven repository URL
|
||||||
credentials {
|
credentials {
|
||||||
username = "your-username" // Replace with your Maven repository username
|
username = ""
|
||||||
password = "your-password" // Replace with your Maven repository password
|
password = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue