{"id":22941808,"url":"https://github.com/zacksleo/substrate-rbac","last_synced_at":"2025-04-01T20:49:55.256Z","repository":{"id":47863654,"uuid":"389336406","full_name":"zacksleo/substrate-rbac","owner":"zacksleo","description":"substrate v3 rbac pallet","archived":false,"fork":false,"pushed_at":"2021-08-12T12:36:02.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T13:47:45.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zacksleo.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}},"created_at":"2021-07-25T11:57:23.000Z","updated_at":"2021-08-12T12:35:45.000Z","dependencies_parsed_at":"2022-08-19T00:01:17.838Z","dependency_job_id":null,"html_url":"https://github.com/zacksleo/substrate-rbac","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacksleo%2Fsubstrate-rbac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacksleo%2Fsubstrate-rbac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacksleo%2Fsubstrate-rbac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacksleo%2Fsubstrate-rbac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zacksleo","download_url":"https://codeload.github.com/zacksleo/substrate-rbac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709912,"owners_count":20821298,"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-12-14T13:45:05.691Z","updated_at":"2025-04-01T20:49:55.238Z","avatar_url":"https://github.com/zacksleo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Substrate Role-based Access Control Pallet\n\nA [Substrate](https://github.com/paritytech/substrate) pallet implementing role-based access control and permissions for Substrate extrinsic calls.\n\nThe filtering of incoming extrinsics and their sender accounts is done at the transaction queue validation layer, using the `SignedExtension` trait.\n\n## Usage\n\n* Add the module's dependency in the `Cargo.toml` of your `runtime` directory. Make sure to enter the correct path or git url of the pallet as per your setup.\n\n```toml\n[dependencies.substrate_rbac]\npackage = 'substrate-rbac'\ngit = 'https://github.com/gautamdhameja/substrate-rbac.git'\ndefault-features = false\n```\n\n* Declare the pallet in your `runtime/src/lib.rs`.\n\n```rust\npub use substrate_rbac;\n\nimpl substrate_rbac::Trait for Runtime {\n    type Event = Event;\n}\n\nconstruct_runtime!(\n    pub enum Runtime where\n        Block = Block,\n        NodeBlock = opaque::Block,\n        UncheckedExtrinsic = UncheckedExtrinsic\n    {\n        ...\n        ...\n        ...\n        RBAC: substrate_rbac::{Module, Call, Storage, Event\u003cT\u003e, Config\u003cT\u003e},\n    }\n);\n```\n\n* Add the module's `Authorize` type in the `SignedExtra` checklist.\n\n```rust\npub type SignedExtra = (\n    ...\n    ...\n    balances::TakeFees\u003cRuntime\u003e,\n    substrate_rbac::Authorize\u003cRuntime\u003e\n```\n\n* Add a genesis configuration for the module in the `src/chain_spec.rs` file.\n\n```rust\nrbac: Some(RBACConfig {\n\tsuper_admins: vec![get_account_id_from_seed::\u003csr25519::Public\u003e(\"Alice\")]\n})\n```\n\n* `cargo build --release` and then `cargo run --release -- --dev`\n\n## Sample\n\nThe usage of this pallet are demonstrated in the [Substrate permissioning sample](https://github.com/gautamdhameja/substrate-permissioning).\n\n## Disclaimer\n\nThis code not audited and reviewed for production use cases. You can expect bugs and security vulnerabilities. Do not use it as-is in real applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacksleo%2Fsubstrate-rbac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzacksleo%2Fsubstrate-rbac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacksleo%2Fsubstrate-rbac/lists"}