admission 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/admission.gemspec +2 -0
  3. data/lib/admission/version.rb +1 -1
  4. metadata +1 -94
  5. data/examples/rails5_feudalism/.gitignore +0 -19
  6. data/examples/rails5_feudalism/.ruby-version +0 -1
  7. data/examples/rails5_feudalism/Gemfile +0 -52
  8. data/examples/rails5_feudalism/README.md +0 -17
  9. data/examples/rails5_feudalism/Rakefile +0 -6
  10. data/examples/rails5_feudalism/app/assets/config/manifest.js +0 -3
  11. data/examples/rails5_feudalism/app/assets/images/.keep +0 -0
  12. data/examples/rails5_feudalism/app/assets/javascripts/application.js +0 -15
  13. data/examples/rails5_feudalism/app/assets/stylesheets/application.css +0 -15
  14. data/examples/rails5_feudalism/app/assets/stylesheets/scaffolds.scss +0 -84
  15. data/examples/rails5_feudalism/app/controllers/application_controller.rb +0 -13
  16. data/examples/rails5_feudalism/app/controllers/concerns/.keep +0 -0
  17. data/examples/rails5_feudalism/app/controllers/users_controller.rb +0 -75
  18. data/examples/rails5_feudalism/app/helpers/application_helper.rb +0 -2
  19. data/examples/rails5_feudalism/app/jobs/application_job.rb +0 -2
  20. data/examples/rails5_feudalism/app/models/application_record.rb +0 -3
  21. data/examples/rails5_feudalism/app/models/concerns/.keep +0 -0
  22. data/examples/rails5_feudalism/app/models/person.rb +0 -11
  23. data/examples/rails5_feudalism/app/models/possession.rb +0 -7
  24. data/examples/rails5_feudalism/app/models/trait.rb +0 -7
  25. data/examples/rails5_feudalism/app/models/user.rb +0 -17
  26. data/examples/rails5_feudalism/app/models/user_status.rb +0 -140
  27. data/examples/rails5_feudalism/app/views/admission/forbidden.html.erb +0 -14
  28. data/examples/rails5_feudalism/app/views/layouts/application.html.erb +0 -15
  29. data/examples/rails5_feudalism/app/views/users/_form.html.erb +0 -19
  30. data/examples/rails5_feudalism/app/views/users/_privilege_row.html.erb +0 -24
  31. data/examples/rails5_feudalism/app/views/users/_privileges_list.html.erb +0 -51
  32. data/examples/rails5_feudalism/app/views/users/edit.html.erb +0 -6
  33. data/examples/rails5_feudalism/app/views/users/index.html.erb +0 -25
  34. data/examples/rails5_feudalism/app/views/users/new.html.erb +0 -5
  35. data/examples/rails5_feudalism/app/views/users/show.html.erb +0 -4
  36. data/examples/rails5_feudalism/bin/bundle +0 -3
  37. data/examples/rails5_feudalism/bin/rails +0 -9
  38. data/examples/rails5_feudalism/bin/rake +0 -9
  39. data/examples/rails5_feudalism/bin/setup +0 -38
  40. data/examples/rails5_feudalism/bin/spring +0 -17
  41. data/examples/rails5_feudalism/bin/update +0 -29
  42. data/examples/rails5_feudalism/bin/yarn +0 -11
  43. data/examples/rails5_feudalism/config.ru +0 -5
  44. data/examples/rails5_feudalism/config/application.rb +0 -28
  45. data/examples/rails5_feudalism/config/boot.rb +0 -3
  46. data/examples/rails5_feudalism/config/database.yml +0 -85
  47. data/examples/rails5_feudalism/config/environment.rb +0 -5
  48. data/examples/rails5_feudalism/config/environments/development.rb +0 -49
  49. data/examples/rails5_feudalism/config/environments/production.rb +0 -82
  50. data/examples/rails5_feudalism/config/environments/test.rb +0 -36
  51. data/examples/rails5_feudalism/config/initializers/application_controller_renderer.rb +0 -8
  52. data/examples/rails5_feudalism/config/initializers/assets.rb +0 -14
  53. data/examples/rails5_feudalism/config/initializers/backtrace_silencers.rb +0 -7
  54. data/examples/rails5_feudalism/config/initializers/cookies_serializer.rb +0 -5
  55. data/examples/rails5_feudalism/config/initializers/filter_parameter_logging.rb +0 -4
  56. data/examples/rails5_feudalism/config/initializers/inflections.rb +0 -16
  57. data/examples/rails5_feudalism/config/initializers/mime_types.rb +0 -4
  58. data/examples/rails5_feudalism/config/initializers/wrap_parameters.rb +0 -14
  59. data/examples/rails5_feudalism/config/locales/en.yml +0 -33
  60. data/examples/rails5_feudalism/config/puma.rb +0 -56
  61. data/examples/rails5_feudalism/config/routes.rb +0 -8
  62. data/examples/rails5_feudalism/config/secrets.yml +0 -32
  63. data/examples/rails5_feudalism/config/spring.rb +0 -6
  64. data/examples/rails5_feudalism/db/migrate/20171018085629_create_users.rb +0 -9
  65. data/examples/rails5_feudalism/db/migrate/20171019082044_create_people.rb +0 -9
  66. data/examples/rails5_feudalism/db/migrate/20171019082055_create_possessions.rb +0 -9
  67. data/examples/rails5_feudalism/db/migrate/20171019082059_create_traits.rb +0 -9
  68. data/examples/rails5_feudalism/db/schema.rb +0 -49
  69. data/examples/rails5_feudalism/db/seeds.rb +0 -7
  70. data/examples/rails5_feudalism/lib/assets/.keep +0 -0
  71. data/examples/rails5_feudalism/lib/tasks/.keep +0 -0
  72. data/examples/rails5_feudalism/log/.keep +0 -0
  73. data/examples/rails5_feudalism/package.json +0 -7
  74. data/examples/rails5_feudalism/public/404.html +0 -67
  75. data/examples/rails5_feudalism/public/422.html +0 -67
  76. data/examples/rails5_feudalism/public/500.html +0 -66
  77. data/examples/rails5_feudalism/public/apple-touch-icon-precomposed.png +0 -0
  78. data/examples/rails5_feudalism/public/apple-touch-icon.png +0 -0
  79. data/examples/rails5_feudalism/public/favicon.ico +0 -0
  80. data/examples/rails5_feudalism/public/robots.txt +0 -1
  81. data/examples/rails5_feudalism/test/application_system_test_case.rb +0 -5
  82. data/examples/rails5_feudalism/test/controllers/.keep +0 -0
  83. data/examples/rails5_feudalism/test/fixtures/.keep +0 -0
  84. data/examples/rails5_feudalism/test/fixtures/files/.keep +0 -0
  85. data/examples/rails5_feudalism/test/fixtures/people.yml +0 -36
  86. data/examples/rails5_feudalism/test/fixtures/possessions.yml +0 -0
  87. data/examples/rails5_feudalism/test/fixtures/traits.yml +0 -0
  88. data/examples/rails5_feudalism/test/fixtures/users.yml +0 -0
  89. data/examples/rails5_feudalism/test/helpers/.keep +0 -0
  90. data/examples/rails5_feudalism/test/models/.keep +0 -0
  91. data/examples/rails5_feudalism/test/models/user_status/rules_test.rb +0 -152
  92. data/examples/rails5_feudalism/test/models/user_status/user_status_test.rb +0 -50
  93. data/examples/rails5_feudalism/test/system/.keep +0 -0
  94. data/examples/rails5_feudalism/test/test_helper.rb +0 -9
  95. data/examples/rails5_feudalism/tmp/.keep +0 -0
  96. data/examples/rails5_feudalism/vendor/.keep +0 -0
  97. data/examples/rails5_feudalism/yarn.lock +0 -7
@@ -1,33 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # The following keys must be escaped otherwise they will not be retrieved by
20
- # the default I18n backend:
21
- #
22
- # true, false, on, off, yes, no
23
- #
24
- # Instead, surround them with single quotes.
25
- #
26
- # en:
27
- # 'true': 'foo'
28
- #
29
- # To learn more, please read the Rails Internationalization guide
30
- # available at http://guides.rubyonrails.org/i18n.html.
31
-
32
- en:
33
- hello: "Hello world"
@@ -1,56 +0,0 @@
1
- # Puma can serve each request in a thread from an internal thread pool.
2
- # The `threads` method setting takes two numbers: a minimum and maximum.
3
- # Any libraries that use thread pools should be configured to match
4
- # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
- # and maximum; this matches the default thread size of Active Record.
6
- #
7
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
- threads threads_count, threads_count
9
-
10
- # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
- #
12
- port ENV.fetch("PORT") { 3000 }
13
-
14
- # Specifies the `environment` that Puma will run in.
15
- #
16
- environment ENV.fetch("RAILS_ENV") { "development" }
17
-
18
- # Specifies the number of `workers` to boot in clustered mode.
19
- # Workers are forked webserver processes. If using threads and workers together
20
- # the concurrency of the application would be max `threads` * `workers`.
21
- # Workers do not work on JRuby or Windows (both of which do not support
22
- # processes).
23
- #
24
- # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
-
26
- # Use the `preload_app!` method when specifying a `workers` number.
27
- # This directive tells Puma to first boot the application and load code
28
- # before forking the application. This takes advantage of Copy On Write
29
- # process behavior so workers use less memory. If you use this option
30
- # you need to make sure to reconnect any threads in the `on_worker_boot`
31
- # block.
32
- #
33
- # preload_app!
34
-
35
- # If you are preloading your application and using Active Record, it's
36
- # recommended that you close any connections to the database before workers
37
- # are forked to prevent connection leakage.
38
- #
39
- # before_fork do
40
- # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
41
- # end
42
-
43
- # The code in the `on_worker_boot` will be called if you are using
44
- # clustered mode by specifying a number of `workers`. After each worker
45
- # process is booted, this block will be run. If you are using the `preload_app!`
46
- # option, you will want to use this block to reconnect to any threads
47
- # or connections that may have been created at application boot, as Ruby
48
- # cannot share connections between processes.
49
- #
50
- # on_worker_boot do
51
- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
52
- # end
53
- #
54
-
55
- # Allow puma to be restarted by `rails restart` command.
56
- plugin :tmp_restart
@@ -1,8 +0,0 @@
1
- Rails.application.routes.draw do
2
-
3
-
4
- resources :cars
5
- resources :users
6
-
7
-
8
- end
@@ -1,32 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rails secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- # Shared secrets are available across all environments.
14
-
15
- # shared:
16
- # api_key: a1B2c3D4e5F6
17
-
18
- # Environmental secrets are only available for that specific environment.
19
-
20
- development:
21
- secret_key_base: f53458c4ced664cb12c8a2e4a3122306cae942889441ee2ddeb4489114bff00383845913d51a6ab420a045521accaa47b16564777608223407aa389bf052d88d
22
-
23
- test:
24
- secret_key_base: 93a915ecd05ac5a8d7ee48bb03212410f5287df04d33f293f1a40d11804875edbd42fdc17d93e111371cde7ac9301271188785ff0f40eab8656fbfbc93f33347
25
-
26
- # Do not keep production secrets in the unencrypted secrets file.
27
- # Instead, either read values from the environment.
28
- # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29
- # and move the `production:` environment over there.
30
-
31
- production:
32
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -1,6 +0,0 @@
1
- %w(
2
- .ruby-version
3
- .rbenv-vars
4
- tmp/restart.txt
5
- tmp/caching-dev.txt
6
- ).each { |path| Spring.watch(path) }
@@ -1,9 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :users do |t|
4
- t.references :person , null: false
5
- t.jsonb :privileges
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreatePeople < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :people do |t|
4
- t.string :name, null: false
5
- t.string :country, null: false
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreatePossessions < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :possessions do |t|
4
- t.string :name, null: false
5
- t.belongs_to :person, null: false
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreateTraits < ActiveRecord::Migration[5.1]
2
- def change
3
- create_table :traits do |t|
4
- t.string :name, null: false
5
- t.belongs_to :person, null: false
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,49 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your
6
- # database schema. If you need to create the application database on another
7
- # system, you should be using db:schema:load, not running all the migrations
8
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
- # you'll amass, the slower it'll run and the greater likelihood for issues).
10
- #
11
- # It's strongly recommended that you check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(version: 20171019082059) do
14
-
15
- # These are extensions that must be enabled in order to support this database
16
- enable_extension "plpgsql"
17
-
18
- create_table "people", force: :cascade do |t|
19
- t.string "name", null: false
20
- t.string "country", null: false
21
- t.datetime "created_at", null: false
22
- t.datetime "updated_at", null: false
23
- end
24
-
25
- create_table "possessions", force: :cascade do |t|
26
- t.string "name", null: false
27
- t.bigint "person_id", null: false
28
- t.datetime "created_at", null: false
29
- t.datetime "updated_at", null: false
30
- t.index ["person_id"], name: "index_possessions_on_person_id"
31
- end
32
-
33
- create_table "traits", force: :cascade do |t|
34
- t.string "name", null: false
35
- t.bigint "person_id", null: false
36
- t.datetime "created_at", null: false
37
- t.datetime "updated_at", null: false
38
- t.index ["person_id"], name: "index_traits_on_person_id"
39
- end
40
-
41
- create_table "users", force: :cascade do |t|
42
- t.bigint "person_id", null: false
43
- t.jsonb "privileges"
44
- t.datetime "created_at", null: false
45
- t.datetime "updated_at", null: false
46
- t.index ["person_id"], name: "index_users_on_person_id"
47
- end
48
-
49
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
- # Character.create(name: 'Luke', movie: movies.first)
File without changes
File without changes
@@ -1,7 +0,0 @@
1
- {
2
- "name": "rails5_feudalism",
3
- "private": true,
4
- "dependencies": {
5
- "jquery": "^3.2.1"
6
- }
7
- }
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>