access-manager
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "access-manager", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A one-stop solution for implementing authenticated and anonymous continuous sessions with user handling and whitelisted acl.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ # access-manager | ||
Use the switch when you start your app with access manager for the first time. (Note that your app will shut down once the import is done.) | ||
If you want some example data or wish to import your ACL from file, use the --import-acl switch when you start your app with access manager (for the first time). Note that your app will shut down once the import is done. | ||
@@ -31,3 +31,5 @@ Use example data: (example-acl.json) | ||
The ACL data installs into the acl collection. _Obviously you're free to populate the acl collection anyway you see fit._ | ||
## Examples: | ||
@@ -159,23 +161,37 @@ | ||
The schemas used in access manager must contain the properties detailed below. (If you don't supply your own schemas these are the defaults) | ||
The schemas used in access manager must contain the properties detailed below. If you don't supply your own schemas these are the defaults: | ||
The userSchema must have the properties: | ||
_The mininum required userSchema:_ | ||
"email" (string), | ||
"password" (string) | ||
"roles" (array of strings) | ||
```javascript | ||
{ | ||
email: {type: String, required:true, unique:true}, | ||
password: {type: String, required:true}, | ||
roles: [String] | ||
} | ||
``` | ||
The sessionSchema must have the properties: | ||
_The mininum required sessionSchema:_ | ||
"loggedIn" (bool) | ||
"user" (reference) | ||
```javascript | ||
{ | ||
loggedIn: {type:Boolean, default:false}, | ||
user: { type: this.mongoose.Schema.Types.ObjectId, ref: 'User' } | ||
} | ||
``` | ||
The aclSchema must have the properties: | ||
_The mininum required aclSchema:_ | ||
"path" (string) | ||
"roles" (array of child schema containing): | ||
"role (string) | ||
"methods (array of string with enum: | ||
['GET', 'POST', 'PUT', 'DELETE', 'ALL']) | ||
```javascript | ||
{ | ||
path: {type: String, unique: true}, | ||
roles: [ | ||
new this.mongoose.Schema({ | ||
role: String, | ||
methods: [{type: String, enum: ['GET', 'POST', 'PUT', 'DELETE', 'ALL']}] | ||
}) | ||
] | ||
} | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12848
195