https://github.com/paraboly/permission-documentation
Permission Architecture Documentation
https://github.com/paraboly/permission-documentation
Last synced: 4 months ago
JSON representation
Permission Architecture Documentation
- Host: GitHub
- URL: https://github.com/paraboly/permission-documentation
- Owner: Paraboly
- Created: 2019-09-21T11:28:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-21T12:41:14.000Z (over 6 years ago)
- Last Synced: 2025-04-09T23:42:58.326Z (about 1 year ago)
- Homepage: https://www.paraboly.com
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Permission Documentation
Permission documantation by examples, encodes and CHMOD system.
### **One and Only Important Note:**
Permission algorithm works from top to bottom !
## Example Data as JSON
```js
userPermissions: [
"system": [
"permission.system.project.*.*.1",
"permission.system.project.*.price_tag.7",
"permission.system.project.*.delete_button.3",
"permission.system.project.button.*.7",
"permission.system.project.costs.*.5",
"permission.system.project.dates.*.0",
],
"internal-plugin":[
"permission.internal-plugin.list.*.*.3",
"permission.internal-plugin.list.*.button.0",
"permission.internal-plugin.list.*.delete_button.3",
"permission.internal-plugin.list.list_item.*.7",
]
]
```
## ENCODE:
```js
permission.${module}.${page}.${component}.${component_id}${permission}
```
### Example ENCODEs:
**No Permission:** ```permission.system.project.*.*.NO_PERMISSION(0)```
**Read:** ```permission.system.project.*.*.READ(1)```
**ALL:** ```permission.system.project.*.*.ALL(7)```
**All Buttons Example**: ```permission.system.project.*.button.NO_PERMISSION(0)```
### Example ENCODE with Advanced Use Case:
```js
permissions: [
"permission.system.project.*.*.1",
"permission.system.project.*.price_tag.7",
"permission.system.project.*.delete_button.3",
"permission.system.project.button.*.7",
"permission.system.project.costs.*.5",
"permission.system.project.dates.*.0",
]
```
## Fundamental CHMOD Architecture
| Value | R | W | X | Description |
| ----- | --- | --- | --- | ------------- |
| 0 | 0 | 0 | 0 | NO_PERMISSION |
| 1 | 1 | 0 | 0 | READ |
| 2 | 0 | 1 | 0 | WRITE |
| 3 | 1 | 1 | 0 | READ/WRITE |
| 4 | 0 | 0 | 1 | EXECUTE |
| 5 | 1 | 0 | 1 | READ/EXECUTE |
| 6 | 0 | 1 | 1 | WRITE/EXECUTE |
| 7 | 1 | 1 | 1 | ALL |