Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markdown headers #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#NODE ACL - Access Control Lists for Node
# NODE ACL - Access Control Lists for Node

This module provides a minimalistic ACL implementation inspired by Zend_ACL.

Expand All @@ -14,13 +14,13 @@ A Redis, MongoDB and In-Memory based backends are provided built-in in the modul

Follow [manast](http://twitter.com/manast) for news and updates regarding this library.

##Status
## Status

[![BuildStatus](https://secure.travis-ci.org/OptimalBits/node_acl.png?branch=master)](http://travis-ci.org/OptimalBits/node_acl)
[![Dependency Status](https://david-dm.org/OptimalBits/node_acl.svg)](https://david-dm.org/OptimalBits/node_acl)
[![devDependency Status](https://david-dm.org/OptimalBits/node_acl/dev-status.svg)](https://david-dm.org/OptimalBits/node_acl#info=devDependencies)

##Features
## Features

- Users
- Roles
Expand All @@ -29,15 +29,15 @@ Follow [manast](http://twitter.com/manast) for news and updates regarding this l
- Express middleware for protecting resources.
- Robust implementation with good unit test coverage.

##Installation
## Installation

Using npm:

```javascript
npm install acl
```

##Documentation
## Documentation

* [addUserRoles](#addUserRoles)
* [removeUserRoles](#removeUserRoles)
Expand All @@ -57,7 +57,7 @@ npm install acl
* [middleware](#middleware)
* [backend](#backend)

##Examples
## Examples

Create your acl module by requiring it and instantiating it with a valid backend instance:

Expand Down Expand Up @@ -205,6 +205,7 @@ app.put('/blogs/:id/comments/:commentId', acl.middleware(3, 'joed', 'post'), fun
## Methods

<a name="addUserRoles"/>

### addUserRoles( userId, roles, function(err) )

Adds roles to a given user id.
Expand All @@ -220,6 +221,7 @@ __Arguments__
---------------------------------------

<a name="removeUserRoles"/>

### removeUserRoles( userId, roles, function(err) )

Remove roles from a given user.
Expand All @@ -235,6 +237,7 @@ __Arguments__
---------------------------------------

<a name="userRoles" />

### userRoles( userId, function(err, roles) )

Return all the roles from a given user.
Expand All @@ -249,6 +252,7 @@ __Arguments__
---------------------------------------

<a name="roleUsers" />

### roleUsers( rolename, function(err, users) )

Return all users who has a given role.
Expand All @@ -263,6 +267,7 @@ __Arguments__
---------------------------------------

<a name="hasRole" />

### hasRole( userId, rolename, function(err, hasRole) )

Return boolean whether user has the role
Expand All @@ -278,6 +283,7 @@ __Arguments__
---------------------------------------

<a name="addRoleParents" />

### addRoleParents( role, parents, function(err) )

Adds a parent or parent list to role.
Expand All @@ -293,6 +299,7 @@ __Arguments__
---------------------------------------

<a name="removeRoleParents" />

### removeRoleParents( role, parents, function(err) )

Removes a parent or parent list from role.
Expand All @@ -310,6 +317,7 @@ __Arguments__
---------------------------------------

<a name="removeRole" />

### removeRole( role, function(err) )

Removes a role from the system.
Expand All @@ -324,6 +332,7 @@ __Arguments__
---------------------------------------

<a name="removeResource" />

### removeResource( resource, function(err) )

Removes a resource from the system
Expand All @@ -338,6 +347,7 @@ __Arguments__
---------------------------------------

<a name="allow" />

### allow( roles, resources, permissions, function(err) )

Adds the given permissions to the given roles over the given resources.
Expand Down Expand Up @@ -365,6 +375,7 @@ __Arguments__
---------------------------------------

<a name="removeAllow" />

### removeAllow( role, resources, permissions, function(err) )

Remove permissions from the given roles owned by the given role.
Expand All @@ -383,6 +394,7 @@ __Arguments__
---------------------------------------

<a name="allowedPermissions" />

### allowedPermissions( userId, resources, function(err, obj) )

Returns all the allowable permissions a given user have to
Expand All @@ -402,6 +414,7 @@ __Arguments__
---------------------------------------

<a name="isAllowed" />

### isAllowed( userId, resource, permissions, function(err, allowed) )

Checks if the given user is allowed to access the resource for the given
Expand All @@ -418,6 +431,7 @@ __Arguments__

---------------------------------------
<a name="areAnyRolesAllowed" />

### areAnyRolesAllowed( roles, resource, permissions, function(err, allowed) )

Returns true if any of the given roles have the right permissions.
Expand All @@ -433,6 +447,7 @@ __Arguments__

---------------------------------------
<a name="whatResources" />

### whatResources(role, function(err, {resourceName: [permissions]})

Returns what resources a given role has permissions over.
Expand All @@ -459,6 +474,7 @@ __Arguments__
---------------------------------------

<a name="middleware" />

### middleware( [numPathComponents, userId, permissions] )

Middleware for express.
Expand All @@ -476,6 +492,7 @@ __Arguments__
---------------------------------------

<a name="backend" />

### backend( db, [prefix] )

Creates a backend instance. All backends except Memory require driver or database instance. `useSingle` is only applicable to the MongoDB backend.
Expand Down Expand Up @@ -504,7 +521,7 @@ var redisBackend = new acl.redisBackend(client);

Creates a new Redis backend using Redis client `client`.

##Tests
## Tests

Run tests with `npm` (requires mocha):
```javascript
Expand All @@ -516,7 +533,7 @@ Run tests with `npm` (requires mocha):
- Support for denials (deny a role a given permission)


##License
## License

(The MIT License)

Expand Down