{"id":18910056,"url":"https://github.com/cheton/rbac","last_synced_at":"2026-03-07T17:30:18.898Z","repository":{"id":6406406,"uuid":"7644600","full_name":"cheton/rbac","owner":"cheton","description":"Role-based access control with javascript (incl. jquery plugin)","archived":false,"fork":false,"pushed_at":"2013-01-25T02:17:40.000Z","size":176,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T12:56:28.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-16T11:35:29.000Z","updated_at":"2018-08-20T15:06:37.000Z","dependencies_parsed_at":"2022-08-31T00:01:16.656Z","dependency_job_id":null,"html_url":"https://github.com/cheton/rbac","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Frbac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Frbac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Frbac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheton%2Frbac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheton","download_url":"https://codeload.github.com/cheton/rbac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239898456,"owners_count":19715212,"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":[],"created_at":"2024-11-08T09:39:10.758Z","updated_at":"2026-03-07T17:30:18.839Z","avatar_url":"https://github.com/cheton.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RBAC [![Build Status](https://travis-ci.org/cheton/rbac.png?branch=master)](https://travis-ci.org/cheton/rbac)\n\nRole-based access control with javascript (incl. jquery plugin)\n\n# Getting Started\n\nAssuming you have the following HTML file\n\n    \u003cdiv class=\"content\"\u003e\n        \u003cdiv data-rbac-roles=\"administrator,moderator\"\u003e\n            \u003cp\u003eOnly administrator or moderator have permission to view this page.\u003c/p\u003e\n        \u003c/div\u003e\n        \u003cdiv data-rbac-permissions=\"delete resources\"\u003e\n            \u003cp\u003eYou have permission to delete resources.\u003c/p\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n\nyou can define the roles and permissions\n\n    rbac.init({\n        role: \"administrator\",\n        rules: {\n            \"administrator\": {\n                permissions: [\n                    \"delete resources\"\n                ],\n                inherits: [\"moderator\"]\n            },\n            \"moderator\": {\n                permissions: [\n                    \"edit resources\",\n                    \"add resources\"\n                ],\n                inherits: [\"guest\"]\n            },\n            \"guest\": {\n                permissions: [\n                    \"view resources\"\n                ],\n                inherits: []\n            }\n        }\n    }, function(rbac) {\n        console.log('Your current role is ' + rbac.role());\n        $('.content').rbac(); // You can remove unauthorized elements from the DOM.\n    });\n\n# License\n\nCopyright (c) 2013 Cheton Wu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheton%2Frbac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheton%2Frbac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheton%2Frbac/lists"}