{"id":19298264,"url":"https://github.com/casbin/revel-authz","last_synced_at":"2025-04-22T09:32:24.342Z","repository":{"id":57598404,"uuid":"92701284","full_name":"casbin/revel-authz","owner":"casbin","description":"revel-authz is an authorization middleware for Revel","archived":false,"fork":false,"pushed_at":"2023-08-06T14:57:45.000Z","size":4,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T10:44:26.804Z","etag":null,"topics":["abac","access-control","acl","authorization","casbin","rbac","revel"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-29T02:44:18.000Z","updated_at":"2021-01-16T22:57:52.000Z","dependencies_parsed_at":"2023-09-26T09:07:51.471Z","dependency_job_id":null,"html_url":"https://github.com/casbin/revel-authz","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"db61753c8b7c9db541e20cef353e5dba82997e3d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Frevel-authz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Frevel-authz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Frevel-authz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Frevel-authz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/revel-authz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246718403,"owners_count":20822567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abac","access-control","acl","authorization","casbin","rbac","revel"],"created_at":"2024-11-09T23:07:26.627Z","updated_at":"2025-04-22T09:32:24.326Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Revel-authz [![Build Status](https://travis-ci.org/casbin/revel-authz.svg?branch=master)](https://travis-ci.org/casbin/revel-authz) [![Coverage Status](https://coveralls.io/repos/github/casbin/revel-authz/badge.svg?branch=master)](https://coveralls.io/github/casbin/revel-authz?branch=master) [![GoDoc](https://godoc.org/github.com/casbin/revel-authz?status.svg)](https://godoc.org/github.com/casbin/revel-authz)\n======\n\nRevel-authz is an authorization middleware for [Revel](https://github.com/revel/revel), it's based on [https://github.com/casbin/casbin](https://github.com/casbin/casbin).\n\n## Installation\n\n    go get github.com/casbin/revel-authz\n\n## Simple Example\n\n```Go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\n    \"github.com/casbin/casbin\"\n\t\"github.com/casbin/revel-authz\"\n\t\"github.com/revel/revel\"\n)\n\nvar testFilters = []revel.Filter{\n\tauthz.AuthzFilter,\n\tfunc(c *revel.Controller, fc []revel.Filter) {\n\t\tc.RenderHTML(\"OK.\")\n\t},\n}\n\nfunc main() {\n\tr, _ := http.NewRequest(\"GET\", \"/dataset1/resource1\", nil)\n    \tr.SetBasicAuth(\"alice\", \"123\")\n    \tw := httptest.NewRecorder()\n    \tc := revel.NewController(revel.NewRequest(r), revel.NewResponse(w))\n    \n    \ttestFilters[0](c, testFilters)\n}\n```\n\n## Documentation\n\nThe 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:\n\n1. ``subject``: the logged-on user name\n2. ``object``: the URL path for the web resource like \"dataset1/item1\"\n3. ``action``: HTTP method like GET, POST, PUT, DELETE, or the high-level actions you defined like \"read-file\", \"write-blog\"\n\n\nFor how to write authorization policy and other details, please refer to [the Casbin's documentation](https://github.com/casbin/casbin).\n\n## Getting Help\n\n- [Casbin](https://github.com/casbin/casbin)\n\n## License\n\nThis project is under MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Frevel-authz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Frevel-authz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Frevel-authz/lists"}