Awesome Open Source
Awesome Open Source

Revel-authz Build Status Coverage Status GoDoc

Revel-authz is an authorization middleware for Revel, it's based on


go get

Simple Example

package main

import (


var testFilters = []revel.Filter{
	func(c *revel.Controller, fc []revel.Filter) {

func main() {
	r, _ := http.NewRequest("GET", "/dataset1/resource1", nil)
    	r.SetBasicAuth("alice", "123")
    	w := httptest.NewRecorder()
    	c := revel.NewController(revel.NewRequest(r), revel.NewResponse(w))
    	testFilters[0](c, testFilters)


The authorization determines a request based on {subject, object, action}, which means what subject can perform what action on what object. In this plugin, the meanings are:

  1. subject: the logged-on user name
  2. object: the URL path for the web resource like "dataset1/item1"
  3. action: HTTP method like GET, POST, PUT, DELETE, or the high-level actions you defined like "read-file", "write-blog"

For how to write authorization policy and other details, please refer to the Casbin's documentation.

Getting Help


This project is under MIT License. See the LICENSE file for the full license text.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Go (198,127
Authorization (1,336
Rbac (495
Acl (436
Access Control (398
Casbin (193
Abac (119
Revel (27
Related Projects