├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE │ └── gem_release_template.md ├── pull_request_template.md └── workflows │ ├── main.yml │ └── push_gem.yml ├── .gitignore ├── .rubocop.yml ├── .rubocop_ignore_git.yml ├── .yardopts ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE.txt ├── README.md ├── Rakefile ├── SECURITY.md ├── bin ├── console └── setup ├── config └── rubocop-rspec.yml ├── lib ├── generators │ ├── pundit │ │ ├── install │ │ │ ├── USAGE │ │ │ ├── install_generator.rb │ │ │ └── templates │ │ │ │ └── application_policy.rb.tt │ │ └── policy │ │ │ ├── USAGE │ │ │ ├── policy_generator.rb │ │ │ └── templates │ │ │ └── policy.rb.tt │ ├── rspec │ │ ├── policy_generator.rb │ │ └── templates │ │ │ └── policy_spec.rb.tt │ └── test_unit │ │ ├── policy_generator.rb │ │ └── templates │ │ └── policy_test.rb.tt ├── pundit.rb └── pundit │ ├── authorization.rb │ ├── cache_store.rb │ ├── cache_store │ ├── legacy_store.rb │ └── null_store.rb │ ├── context.rb │ ├── error.rb │ ├── helper.rb │ ├── policy_finder.rb │ ├── railtie.rb │ ├── rspec.rb │ └── version.rb ├── pundit.gemspec └── spec ├── authorization_spec.rb ├── generators_spec.rb ├── policies └── post_policy_spec.rb ├── policy_finder_spec.rb ├── pundit └── helper_spec.rb ├── pundit_spec.rb ├── rspec_dsl_spec.rb ├── simple_cov_check_action_formatter.rb ├── spec_helper.rb └── support ├── lib ├── controller.rb ├── custom_cache.rb └── instance_tracking.rb ├── models ├── article.rb ├── article_tag.rb ├── artificial_blog.rb ├── blog.rb ├── comment.rb ├── comment_four_five_six.rb ├── comment_scope.rb ├── comments_relation.rb ├── customer │ └── post.rb ├── default_scope_contains_error.rb ├── dummy_current_user.rb ├── foo.rb ├── post.rb ├── post_four_five_six.rb ├── project_one_two_three │ ├── avatar_four_five_six.rb │ └── tag_four_five_six.rb └── wiki.rb └── policies ├── article_tag_other_name_policy.rb ├── base_policy.rb ├── blog_policy.rb ├── comment_policy.rb ├── criteria_policy.rb ├── default_scope_contains_error_policy.rb ├── denier_policy.rb ├── dummy_current_user_policy.rb ├── nil_class_policy.rb ├── post_policy.rb ├── project ├── admin │ └── comment_policy.rb ├── comment_policy.rb ├── criteria_policy.rb └── post_policy.rb ├── project_one_two_three ├── avatar_four_five_six_policy.rb ├── comment_four_five_six_policy.rb ├── criteria_four_five_six_policy.rb ├── post_four_five_six_policy.rb └── tag_four_five_six_policy.rb ├── publication_policy.rb └── wiki_policy.rb /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/ISSUE_TEMPLATE/bug_report.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/ISSUE_TEMPLATE/feature_request.md -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/gem_release_template.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/PULL_REQUEST_TEMPLATE/gem_release_template.md -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/pull_request_template.md -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/workflows/main.yml -------------------------------------------------------------------------------- /.github/workflows/push_gem.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.github/workflows/push_gem.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.gitignore -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.rubocop.yml -------------------------------------------------------------------------------- /.rubocop_ignore_git.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.rubocop_ignore_git.yml -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/.yardopts -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/Gemfile -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/README.md -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/Rakefile -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/SECURITY.md -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/bin/console -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/bin/setup -------------------------------------------------------------------------------- /config/rubocop-rspec.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/config/rubocop-rspec.yml -------------------------------------------------------------------------------- /lib/generators/pundit/install/USAGE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/install/USAGE -------------------------------------------------------------------------------- /lib/generators/pundit/install/install_generator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/install/install_generator.rb -------------------------------------------------------------------------------- /lib/generators/pundit/install/templates/application_policy.rb.tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/install/templates/application_policy.rb.tt -------------------------------------------------------------------------------- /lib/generators/pundit/policy/USAGE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/policy/USAGE -------------------------------------------------------------------------------- /lib/generators/pundit/policy/policy_generator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/policy/policy_generator.rb -------------------------------------------------------------------------------- /lib/generators/pundit/policy/templates/policy.rb.tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/pundit/policy/templates/policy.rb.tt -------------------------------------------------------------------------------- /lib/generators/rspec/policy_generator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/rspec/policy_generator.rb -------------------------------------------------------------------------------- /lib/generators/rspec/templates/policy_spec.rb.tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/rspec/templates/policy_spec.rb.tt -------------------------------------------------------------------------------- /lib/generators/test_unit/policy_generator.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/test_unit/policy_generator.rb -------------------------------------------------------------------------------- /lib/generators/test_unit/templates/policy_test.rb.tt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/generators/test_unit/templates/policy_test.rb.tt -------------------------------------------------------------------------------- /lib/pundit.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit.rb -------------------------------------------------------------------------------- /lib/pundit/authorization.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/authorization.rb -------------------------------------------------------------------------------- /lib/pundit/cache_store.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/cache_store.rb -------------------------------------------------------------------------------- /lib/pundit/cache_store/legacy_store.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/cache_store/legacy_store.rb -------------------------------------------------------------------------------- /lib/pundit/cache_store/null_store.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/cache_store/null_store.rb -------------------------------------------------------------------------------- /lib/pundit/context.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/context.rb -------------------------------------------------------------------------------- /lib/pundit/error.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/error.rb -------------------------------------------------------------------------------- /lib/pundit/helper.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/helper.rb -------------------------------------------------------------------------------- /lib/pundit/policy_finder.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/policy_finder.rb -------------------------------------------------------------------------------- /lib/pundit/railtie.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/railtie.rb -------------------------------------------------------------------------------- /lib/pundit/rspec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/rspec.rb -------------------------------------------------------------------------------- /lib/pundit/version.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/lib/pundit/version.rb -------------------------------------------------------------------------------- /pundit.gemspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/pundit.gemspec -------------------------------------------------------------------------------- /spec/authorization_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/authorization_spec.rb -------------------------------------------------------------------------------- /spec/generators_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/generators_spec.rb -------------------------------------------------------------------------------- /spec/policies/post_policy_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/policies/post_policy_spec.rb -------------------------------------------------------------------------------- /spec/policy_finder_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/policy_finder_spec.rb -------------------------------------------------------------------------------- /spec/pundit/helper_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/pundit/helper_spec.rb -------------------------------------------------------------------------------- /spec/pundit_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/pundit_spec.rb -------------------------------------------------------------------------------- /spec/rspec_dsl_spec.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/rspec_dsl_spec.rb -------------------------------------------------------------------------------- /spec/simple_cov_check_action_formatter.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/simple_cov_check_action_formatter.rb -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/spec_helper.rb -------------------------------------------------------------------------------- /spec/support/lib/controller.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/lib/controller.rb -------------------------------------------------------------------------------- /spec/support/lib/custom_cache.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/lib/custom_cache.rb -------------------------------------------------------------------------------- /spec/support/lib/instance_tracking.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/lib/instance_tracking.rb -------------------------------------------------------------------------------- /spec/support/models/article.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Article 4 | end 5 | -------------------------------------------------------------------------------- /spec/support/models/article_tag.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/article_tag.rb -------------------------------------------------------------------------------- /spec/support/models/artificial_blog.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/artificial_blog.rb -------------------------------------------------------------------------------- /spec/support/models/blog.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Blog 4 | end 5 | -------------------------------------------------------------------------------- /spec/support/models/comment.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/comment.rb -------------------------------------------------------------------------------- /spec/support/models/comment_four_five_six.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/comment_four_five_six.rb -------------------------------------------------------------------------------- /spec/support/models/comment_scope.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/comment_scope.rb -------------------------------------------------------------------------------- /spec/support/models/comments_relation.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/comments_relation.rb -------------------------------------------------------------------------------- /spec/support/models/customer/post.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/customer/post.rb -------------------------------------------------------------------------------- /spec/support/models/default_scope_contains_error.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/default_scope_contains_error.rb -------------------------------------------------------------------------------- /spec/support/models/dummy_current_user.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/dummy_current_user.rb -------------------------------------------------------------------------------- /spec/support/models/foo.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Foo 4 | end 5 | -------------------------------------------------------------------------------- /spec/support/models/post.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/post.rb -------------------------------------------------------------------------------- /spec/support/models/post_four_five_six.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/post_four_five_six.rb -------------------------------------------------------------------------------- /spec/support/models/project_one_two_three/avatar_four_five_six.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/project_one_two_three/avatar_four_five_six.rb -------------------------------------------------------------------------------- /spec/support/models/project_one_two_three/tag_four_five_six.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/models/project_one_two_three/tag_four_five_six.rb -------------------------------------------------------------------------------- /spec/support/models/wiki.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class Wiki 4 | end 5 | -------------------------------------------------------------------------------- /spec/support/policies/article_tag_other_name_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/article_tag_other_name_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/base_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/base_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/blog_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/blog_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/comment_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/comment_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/criteria_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/criteria_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/default_scope_contains_error_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/default_scope_contains_error_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/denier_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/denier_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/dummy_current_user_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/dummy_current_user_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/nil_class_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/nil_class_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/post_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/post_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project/admin/comment_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project/admin/comment_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project/comment_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project/comment_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project/criteria_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project/criteria_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project/post_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project/post_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project_one_two_three/avatar_four_five_six_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project_one_two_three/avatar_four_five_six_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project_one_two_three/comment_four_five_six_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project_one_two_three/comment_four_five_six_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project_one_two_three/criteria_four_five_six_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project_one_two_three/criteria_four_five_six_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project_one_two_three/post_four_five_six_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project_one_two_three/post_four_five_six_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/project_one_two_three/tag_four_five_six_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/project_one_two_three/tag_four_five_six_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/publication_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/publication_policy.rb -------------------------------------------------------------------------------- /spec/support/policies/wiki_policy.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/varvet/pundit/HEAD/spec/support/policies/wiki_policy.rb --------------------------------------------------------------------------------