{"id":15406746,"url":"https://github.com/dannyben/pundit_extra","last_synced_at":"2025-09-03T07:33:00.775Z","repository":{"id":43293842,"uuid":"51381228","full_name":"DannyBen/pundit_extra","owner":"DannyBen","description":"Extensions and helpers for Pundit","archived":false,"fork":false,"pushed_at":"2025-08-01T15:36:35.000Z","size":61,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-20T04:48:46.567Z","etag":null,"topics":["authorization","gem","pundit","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/DannyBen.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-02-09T16:48:58.000Z","updated_at":"2025-08-01T15:36:39.000Z","dependencies_parsed_at":"2024-10-19T12:33:19.248Z","dependency_job_id":"ac115321-d773-4e66-ba68-4f829038ef5e","html_url":"https://github.com/DannyBen/pundit_extra","commit_stats":{"total_commits":61,"total_committers":3,"mean_commits":"20.333333333333332","dds":0.4426229508196722,"last_synced_commit":"b12840feba1dfe5a8ff74afff886285026e9749b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/DannyBen/pundit_extra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fpundit_extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fpundit_extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fpundit_extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fpundit_extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/pundit_extra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fpundit_extra/sbom","scorecard":{"id":37161,"data":{"date":"2025-08-11","repo":{"name":"github.com/DannyBen/pundit_extra","commit":"2810732c7a24e75976bfd023874224e88cd7aab1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/DannyBen/pundit_extra/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/DannyBen/pundit_extra/test.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T20:35:51.650Z","repository_id":43293842,"created_at":"2025-08-14T20:35:51.650Z","updated_at":"2025-08-14T20:35:51.650Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273409320,"owners_count":25100442,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","gem","pundit","rails","ruby"],"created_at":"2024-10-01T16:25:10.519Z","updated_at":"2025-09-03T07:33:00.724Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PunditExtra\n\nThis library borrows functionality from [CanCan(Can)][2] and adds it to [Pundit][1].\n\n- `can?` and `cannot?` view helpers\n- `load_resource`, `authorize_resource`, `load_and_authorize_resource` and \n  `skip_authorization` controller filters\n\nThe design intentions were:\n\n1. To ease the transition from CanCanCan to Pundit.\n2. To reduce boilerplate code in controller methods.\n3. To keep things simple and intentionally avoid dealing with edge cases or\n   endless magical options you need to memorize.\n\n---\n\n## Install\n\nAdd to your Gemfile:\n\n```\ngem 'pundit_extra'\n```\n\nAdd to your `ApplicationController`:\n\n```ruby\nclass ApplicationController \u003c ActionController::Base\n  include Pundit::Authorization\n  include PunditExtra\nend\n```\n\n\n## View Helpers:  `can?` and `cannot?` \n\nYou can use the convenience methods `can?` and `cannot?` in any controller \nand view.\n\n- `if can? :assign, @task` is the same as Pundit's `policy(@task).assign?`\n- `if can? :index, Task` is the same as Pundit's `policy(Task).index?`\n- `if cannot? :assign, @task` is the opposite of `can?`\n\n\n## Autoload and Authorize Resource\n\nYou can add these to your controllers to automatically load the resource \nand/or authorize it. \n\n```ruby\nclass TasksController \u003c ApplicationController\n  before_action :authenticate_user!\n  load_resource except: [:index, :create]\n  authorize_resource except: [:create]\nend\n```\n\nThe `load_resource` filter will create the appropriate instance variable \nbased on the current action.\n\nThe `authorize_resource` filter will call Pundit's `authorize @model` in each\naction.\n\nYou can use `except: :action`, or `only: :action` to limit the filter to a \ngiven action or an array of actions.\n\nExample:\n\n```ruby\nclass TasksController \u003c ApplicationController\n  before_action :authenticate_user!\n  load_resource except: [:edit, :complete]\n  authorize_resource except: :index\n\n  def index\n    # this happens automatically\n    # @tasks = policy_scope(Task)\n  end\n\n  def show\n    # this happens automatically\n    # @task = Task.find params[:id]\n    # authorize @task\n  end\n\n  def new\n    # this happens automatically\n    # @task = Task.new\n    # authorize @task\n  end\n\n  def create\n    # this happens automatically\n    # @task = Task.new task_params\n    # authorize @task\n  end\n\nend\n```\n\nIn addition, you can use:\n\n- `load_and_authorize_resource` which is a combination shortcut for \n  `load_resource` and `authorize_resource`\n- `skip_authorization` which sends `skip_authorization` and \n  `skip_policy_scope` to Pundit for all (or the specified) actions.\n\n## Credits\n\n- [Jonas Nicklas](https://github.com/jnicklas) @ [Pundit][1]\n- [Bryan Rite](https://github.com/bryanrite), [Ryan Bates](https://github.com/ryanb), [Richard Wilson](https://github.com/Senjai) @ [CanCanCan][2]\n- [Tom Morgan](https://github.com/seven1m)\n\nThanks for building awesome stuff.\n\n---\n\n[1]: https://github.com/elabs/pundit\n[2]: https://github.com/CanCanCommunity/cancancan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fpundit_extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Fpundit_extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fpundit_extra/lists"}