{"id":15430630,"url":"https://github.com/wshihadeh/authorize_rbac","last_synced_at":"2026-05-07T19:17:38.159Z","repository":{"id":56842673,"uuid":"104665490","full_name":"wshihadeh/authorize_rbac","owner":"wshihadeh","description":"Rule Based access control","archived":false,"fork":false,"pushed_at":"2017-09-24T18:16:03.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-25T04:09:51.813Z","etag":null,"topics":["authorization","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/wshihadeh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-24T18:08:25.000Z","updated_at":"2018-01-10T09:11:16.000Z","dependencies_parsed_at":"2022-09-14T17:31:48.603Z","dependency_job_id":null,"html_url":"https://github.com/wshihadeh/authorize_rbac","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wshihadeh/authorize_rbac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wshihadeh%2Fauthorize_rbac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wshihadeh%2Fauthorize_rbac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wshihadeh%2Fauthorize_rbac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wshihadeh%2Fauthorize_rbac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wshihadeh","download_url":"https://codeload.github.com/wshihadeh/authorize_rbac/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wshihadeh%2Fauthorize_rbac/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32752228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authorization","rails","ruby"],"created_at":"2024-10-01T18:17:42.869Z","updated_at":"2026-05-07T19:17:38.113Z","avatar_url":"https://github.com/wshihadeh.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AuthorizeRbac\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'authorize_rbac'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install authorize_rbac\n\n## Usage\n\n- Generate necessary changes\n  - You can generate all migration using the follwing command\n\n    ```\n      bundle exec rails g authorize_rbac install\n    ```\n\n  - Or you can do it one by one\n\n    ```\n    bundle exec rails g authorize_rbac user_migrate\n    bundle exec rails g authorize_rbac role_migrate\n    bundle exec rails g authorize_rbac update_application_controller\n    bundle exec rails g authorize_rbac update_user_model\n    bundle exec rails g authorize_rbac initializer\n    ```\n\n  - Generator help\n    ```\n    bundle exec rails g authorize_rbac user_migrate\n    ```\n\n- Check the generated files and update them if necessary\n- Execute migration\n  ```\n  bundle exec rake db:migrate\n  ```\n\n- Update Controller Methods with the allowed roles\n  ```\n   class MyController \u003c ApplicationController\n\n    roles :admin\n    def admin_only\n      \"admin\"\n    end\n\n    roles :admin, :user\n    def admin_and_user\n      \"admin_and_user\"\n    end\n\n    def all\n      \"all\"\n    end\n  end\n  ```\n\n  - Default role is user, you need to update the registration process to assign users to roles.\n  - if roles is not defined for a given action, then the action is allowed for all users.\n  - To add a dynamic permission for a given role from rails console, use the following commands\n  ```\n  $-\u003e role = Role.find :id\n  $-\u003e role.permissions = [:admin_index]\n  $-\u003e role.save\n\n  ```\n- role.permissions is an array of all allowed actions. The items of this array are constructed with the following schema \"#{controller_name}_#{action_name}\". for instance, to allow the action `users` on `AdminController`, you need to add this to the permissions list `:admin_users`.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwshihadeh%2Fauthorize_rbac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwshihadeh%2Fauthorize_rbac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwshihadeh%2Fauthorize_rbac/lists"}