Skip to content

Commit effa9ae

Browse files
committed
updated version and readme.
1 parent 046585d commit effa9ae

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# TrivialPermissions
2-
A simple RBAC implementation that is datasource agnostic.
2+
3+
A simple RBAC implementation with object level permissions that is datasource agnostic. I've designed it to be easy to
4+
integrate into existing projects, while being flexible and very simple to use. It may not be the most powerful
5+
permission system ever devised, but it is one of the easiest to get up and running with in very little time.
6+
7+
## Installation
8+
9+
### Node.js / Browserify
10+
11+
Simply install with NPM:
12+
13+
```bash
14+
$ npm install --save trivialperms
15+
```
16+
17+
### Bower
18+
19+
```bash
20+
$ bower install --save trivialperms
21+
```
22+
23+
### Generic
24+
25+
Download the latest release from the [Releases][] page, and put it in your project.
26+
27+
[Releases]: https://github.com/trivialsoftware/TrivialPermissions/releases
28+
29+
## Usage
30+
31+
TrivialPermissions is built on the concept of 'role based access control'. In essence, a `user` is a member of a
32+
`group`. That group has specific `permissions`. A user may also have specific `permissions` granted. These permissions
33+
are on an `object` basis.
34+
35+
### Permissions
36+
37+
In TrivialPermissions, a `permission` is a string that looks like the following:
38+
39+
```javascript
40+
'ObjectDescriptor/PermissionDescriptor'
41+
```
42+
43+
This allows us to specify permissions on a per object basis. If you want to specify the permissions on an object from
44+
the database, simply use that id as the object in the permission: `3dqZ7/somePerm`. Alternatively, you may wish to use
45+
more generic object names, like, `'Accounting'`, or `'Posts'`, or something along those lines. TrivialPermissions does
46+
not care, so long as you specify an object descriptor and a permission descriptor.
47+
48+
#### Glob Matching
49+
50+
TrivialPermissions has special support for `*`. It can be used as either an object descriptor, or a permission descriptor.
51+
It matches any permissions passed in. If you want a user or group to have all permissions for all objects, specify
52+
`'*/**'`.
53+
54+
### Groups
55+
56+
TBD.
57+
58+
### Checking Permissions
59+
60+
TBD.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trivialperms",
3-
"version": "1.0.0-alpha.1",
3+
"version": "1.0.0-rc.1",
44
"description": "A simple RBAC implementation that is datasource agnostic.",
55
"main": "./dist/trivialperms.js",
66
"scripts": {

0 commit comments

Comments
 (0)