<commit_before>#Permissions [![Build Status](https://travis-ci.org/xyproto/permissions.svg?branch=master)](https://travis-ci.org/xyproto/permissions) [![GoDoc](https://godoc.org/github.com/xyproto/permissions?status.svg)](http://godoc.org/github.com/xyproto/permissions)

Middleware for [Negroni](https://github.com/codegangsta/negroni), for keeping track of users, login states and permissions. Can also be used together with [Martini](https://github.com/go-martini/martini), either directly or by using the [fizz](https://github.com/xyproto/fizz) package. May also work with other web-related packages, since the standard http.HandlerFunc is used everywhere.


Online API Documentation
------------------------

[godoc.org](http://godoc.org/github.com/xyproto/permissions)


Features and limitations
------------------------

* Uses secure cookies and stores user information in a Redis database. 
* Suitable for running a local Redis server, registering/confirming users and managing public/user/admin pages.
* Supports registration and confirmation via generated confirmation codes.
* Tries to keep things simple.
* Only supports "public", "user" and "admin" permissions out of the box, but offers functionality for implementing more fine grained permissions, if so desired.


Example for [Negroni](https://github.com/codegangsta/negroni)
--------------------
~~~ go
package main<commit_msg>Formatting<commit_after>#Permissions [![Build Status](https://travis-ci.org/xyproto/permissions.svg?branch=master)](https://travis-ci.org/xyproto/permissions) [![GoDoc](https://godoc.org/github.com/xyproto/permissions?status.svg)](http://godoc.org/github.com/xyproto/permissions)

Middleware for [Negroni](https://github.com/codegangsta/negroni), for keeping track of users, login states and permissions.

Online API Documentation
------------------------

[godoc.org](http://godoc.org/github.com/xyproto/permissions)


Features and limitations
------------------------

* Uses secure cookies and stores user information in a Redis database. 
* Suitable for running a local Redis server, registering/confirming users and managing public/user/admin pages.
* Supports registration and confirmation via generated confirmation codes.
* Tries to keep things simple.
* Only supports "public", "user" and "admin" permissions out of the box, but offers functionality for implementing more fine grained permissions, if so desired.
* Can also be used together with [Martini](https://github.com/go-martini/martini), either directly or by using the [fizz](https://github.com/xyproto/fizz) package.
* May also work with other web-related packages, since the standard http.HandlerFunc is used everywhere.



Example for [Negroni](https://github.com/codegangsta/negroni)
--------------------
~~~ go
package main
{'fraction_non_alphanumeric': 0.15406664278036547, 'fraction_numerical': 0.0, 'mean_word_length': 4.067150635208711, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '271464', 'n_tokens_mistral': 758, 'n_tokens_neox': 749, 'n_words': 235}