kadmin 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (351) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +35 -0
  3. data/Rakefile +146 -0
  4. data/app/assets/javascripts/rails_admin/application.js +3 -0
  5. data/app/assets/stylesheets/rails_admin/application.scss +50 -0
  6. data/app/assets/stylesheets/rails_admin/finder.scss +2 -0
  7. data/app/controllers/kadmin/application_controller.rb +58 -0
  8. data/app/controllers/kadmin/auth_controller.rb +98 -0
  9. data/app/controllers/kadmin/concerns/authorized_user.rb +67 -0
  10. data/app/controllers/kadmin/dash_controller.rb +19 -0
  11. data/app/controllers/rails_admin/application_controller.rb +58 -0
  12. data/app/helpers/kadmin/application_helper.rb +4 -0
  13. data/app/helpers/kadmin/bootstrap_helper.rb +53 -0
  14. data/app/helpers/kadmin/form_builder.rb +9 -0
  15. data/app/helpers/kadmin/forms/inverted_check_box.rb +10 -0
  16. data/app/helpers/kadmin/navigation_helper.rb +28 -0
  17. data/app/helpers/kadmin/pagination_helper.rb +95 -0
  18. data/app/views/kadmin/_alerts.html.erb +14 -0
  19. data/app/views/kadmin/auth/login.html.erb +4 -0
  20. data/app/views/kadmin/dash/index.html.erb +5 -0
  21. data/app/views/kadmin/error.html.erb +5 -0
  22. data/app/views/layouts/kadmin/application.html.erb +68 -0
  23. data/config/initializers/action_view.rb +2 -0
  24. data/config/initializers/assets.rb +5 -0
  25. data/config/locales/de.yml +14 -0
  26. data/config/locales/en.yml +14 -0
  27. data/config/routes.rb +12 -0
  28. data/lib/kadmin.rb +19 -0
  29. data/lib/kadmin/auth.rb +31 -0
  30. data/lib/kadmin/auth/configuration.rb +66 -0
  31. data/lib/kadmin/auth/unauthorized_error.rb +14 -0
  32. data/lib/kadmin/auth/user.rb +15 -0
  33. data/lib/kadmin/auth/user_store.rb +21 -0
  34. data/lib/kadmin/configuration.rb +18 -0
  35. data/lib/kadmin/engine.rb +15 -0
  36. data/lib/kadmin/error.rb +7 -0
  37. data/lib/kadmin/errors/authorization.rb +15 -0
  38. data/lib/kadmin/form.rb +64 -0
  39. data/lib/kadmin/version.rb +3 -0
  40. data/test/dummy/README.rdoc +28 -0
  41. data/test/dummy/Rakefile +6 -0
  42. data/test/dummy/app/assets/javascripts/application.js +13 -0
  43. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  44. data/test/dummy/app/controllers/admin_controller.rb +4 -0
  45. data/test/dummy/app/controllers/application_controller.rb +5 -0
  46. data/test/dummy/app/controllers/authorized_controller.rb +8 -0
  47. data/test/dummy/app/helpers/application_helper.rb +2 -0
  48. data/test/dummy/app/models/person.rb +6 -0
  49. data/test/dummy/app/models/relationship.rb +4 -0
  50. data/test/dummy/app/views/admin/index.html.erb +1 -0
  51. data/test/dummy/app/views/authorized/index.html.erb +1 -0
  52. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  53. data/test/dummy/bin/bundle +3 -0
  54. data/test/dummy/bin/rails +4 -0
  55. data/test/dummy/bin/rake +4 -0
  56. data/test/dummy/bin/setup +29 -0
  57. data/test/dummy/config.ru +4 -0
  58. data/test/dummy/config/application.rb +33 -0
  59. data/test/dummy/config/boot.rb +5 -0
  60. data/test/dummy/config/database.yml +22 -0
  61. data/test/dummy/config/environment.rb +5 -0
  62. data/test/dummy/config/environments/development.rb +41 -0
  63. data/test/dummy/config/environments/production.rb +79 -0
  64. data/test/dummy/config/environments/test.rb +42 -0
  65. data/test/dummy/config/initializers/assets.rb +10 -0
  66. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  67. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  68. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  69. data/test/dummy/config/initializers/inflections.rb +16 -0
  70. data/test/dummy/config/initializers/mime_types.rb +4 -0
  71. data/test/dummy/config/initializers/rails_admin.rb +30 -0
  72. data/test/dummy/config/initializers/session_store.rb +3 -0
  73. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  74. data/test/dummy/config/locales/en.yml +23 -0
  75. data/test/dummy/config/routes.rb +10 -0
  76. data/test/dummy/config/secrets.yml +22 -0
  77. data/test/dummy/db/dummy_development.sqlite3 +0 -0
  78. data/test/dummy/db/migrate/20161006114509_create_people.rb +11 -0
  79. data/test/dummy/db/migrate/20161006121212_create_relationships.rb +12 -0
  80. data/test/dummy/log/development.log +9192 -0
  81. data/test/dummy/public/404.html +67 -0
  82. data/test/dummy/public/422.html +67 -0
  83. data/test/dummy/public/500.html +66 -0
  84. data/test/dummy/public/favicon.ico +0 -0
  85. data/test/dummy/test/fixtures/children.yml +11 -0
  86. data/test/dummy/test/fixtures/people.yml +11 -0
  87. data/test/dummy/test/models/child_test.rb +7 -0
  88. data/test/dummy/test/models/person_test.rb +7 -0
  89. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-E/-E7l5lmqv4YBdAJz55GQp5nq67ZkFAo6Bi5OjNk5wH0.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-G/-GztuOFiffIyLHRd9L2OrRr8LvduErePFmti2KiEWnM.cache +0 -0
  91. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-K/-Ki0cNlcEH7alAxkgEojJTity_R8pKPW8lod9PdmQp4.cache +1 -0
  92. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-S/-SGTTENeaJKzAlSGQyBL5smW1ac-1PPh4AH47eMjetw.cache +0 -0
  93. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-_/-_GyWOMxsUj1Vcwf_522X6jS5CyLaFUziq4bW17lZAw.cache +2 -0
  94. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-o/-o5iam1FF5YJGGfs0g8b1t-piKLXB10xQ4JjXn7HN8Q.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-t/-tU5oPMLVsB5iiapWYUTFN5jspQTpVWoTTnhK_T7BJM.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-v/-vqOeGJFsynFKnmqppb24llGxbmWaQxSHrnq-4gWjPc.cache +2 -0
  97. data/test/dummy/tmp/cache/assets/sprockets/v3.0/02/02bxKc4v-CFhk80q91j1gozmURNqN0I63O4ktseQPWo.cache +1 -0
  98. data/test/dummy/tmp/cache/assets/sprockets/v3.0/0K/0K_O16_TTwLqEVY-HrOyDGoLlmGCAT5_-UklcrTwKZo.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/sprockets/v3.0/0h/0hlU_9u3244srcgFGcCeEdEbxinDO7uTAksu_KANv3c.cache +2 -0
  100. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1G/1Gwco3SudXOMtMBavPEiJ7RnnpuHGrDhqen6FYs-CW4.cache +1 -0
  101. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1k/1kLUgMwR_HCyTvfZZneXlYEyVfRtLtCf4uZ3JJ-0jZQ.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1k/1ktYHtX5nxdFuMPRPrFq16xXfbXcyVvGF6FD22sawZA.cache +1 -0
  103. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1t/1ttjS_QLsxhOqT3FIJCJpWKjvclLlWBtCHR4Y0SMWvg.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/sprockets/v3.0/27/27GrPfnHjlwE3wzZR1liVRgIOi7ye17uUxTmw0C17R8.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2I/2IjCzre4F7zp0kbCch9Z00-pd5NZ6oNLGYi2yqcBGS0.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2J/2JVDRZ9rv7kK6_56h-WJp7Vi3lU7ILSeJpKsPbz1XjU.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/sprockets/v3.0/2t/2tt7uQX7uibhc3Ug9tgKtYLEChzWSC-9zplEIe5dOCA.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/sprockets/v3.0/35/35Pg6lXHpJCBRpquM_0_zK8N-YexyeVLStSseoTZWu0.cache +1 -0
  109. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3J/3Jxkh8tw9o9Iu6lPKDOzHtvDfuMHG0IEX4uijWVkfcU.cache +0 -0
  110. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3Z/3Zl_QvMHiv0wLX0SEpTErkJp79NTGB9M9WKwLc0SCJU.cache +1 -0
  111. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3a/3amUAFAEPwz73mf3a0mLt1dWaqdvYWSVTvbdJfdQB0U.cache +0 -0
  112. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4T/4TYzWI_JMt0N69Lhj7iUsoMulFrqqTMgQa7WjMAXby4.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/sprockets/v3.0/4y/4yYl2fQVTLy8WmVy4JS1KQWVTwyXi02mS21TDGFg0Uo.cache +0 -0
  114. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5E/5EK4YMOiNjfof61fycHKHeTg9YQvAvkhSKjWLEjuglk.cache +2 -0
  115. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
  116. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5v/5vEKbxisLQKkt2c6CMW14lmsTmiaHhIxePJGI4EjkWY.cache +1 -0
  117. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5v/5vNvcOzIEB6PiHBs2Q0WDFEQm9dxiD7NLXGau9FscKU.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6P/6Ptq88_RYtY6LvyQvntLJsXt6ShxcNHEdrBGIGv16A4.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6c/6cjYZuXD-Z6hTNUsDx3kylQmppb7bKMHGRCIFMGe0Ow.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7-/7-nFXT-mepU6ZjvvktlBtDlXhZ7b-bqNP-OiXAlEfOA.cache +1 -0
  121. data/test/dummy/tmp/cache/assets/sprockets/v3.0/71/71HhlTQ0x8w11jacZX1YXOGKLgQP5YtSZlsUILezcHU.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7G/7GPgsy2RZq8oH9dXjsVSy2tnjQUAGDViTJ_hoIWWZHw.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7Z/7ZwXstn6Mz77ciiwrR-fSsInEHKx3_hC-8WKq8MajcM.cache +0 -0
  124. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7n/7nTeXy635_E0021GPrY9liLy0OcA24r9yMv3JRZpRU0.cache +1 -0
  125. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8v/8v3HUrggYouCOdFFSOnPQeeJB-Xw50TGMmz3P-5rp-w.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/sprockets/v3.0/9u/9u_JAcGXAbv46kvKHDanRFSBejhRPiviviuc63zlv6Y.cache +2 -0
  127. data/test/dummy/tmp/cache/assets/sprockets/v3.0/A0/A0qGf4ml31v0AV1CnLrNphYxKK4NMWEHlm6jL15vtfo.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/sprockets/v3.0/A7/A72TkC30Vq7CX3sN-bZzghZSyQD5TfoEHppQhjWBbQc.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AM/AMZZZzlJgjZVIRxe6ogpt0JsFsvlUYmjPaKaCTm4uSY.cache +1 -0
  130. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Aj/AjduCjY5yKSragbRfix-ZzJmxPyRI05Bl274GjxlyOU.cache +0 -0
  131. data/test/dummy/tmp/cache/assets/sprockets/v3.0/B2/B2ynLSu6UriibYlEl4dnrXDXdWJVgYccjhDwrdwgyBc.cache +0 -0
  132. data/test/dummy/tmp/cache/assets/sprockets/v3.0/B3/B3HSs7YL9-V-LyTFlpPC7DlZ3Dxc2HrvGRaStrb9SYc.cache +1 -0
  133. data/test/dummy/tmp/cache/assets/sprockets/v3.0/BG/BGVHH6VEpL2MmLznbhFAvRmYAY5J_n1-tCy0mLo54JE.cache +0 -0
  134. data/test/dummy/tmp/cache/assets/sprockets/v3.0/BJ/BJAOVjCMeTjiOu11zW_a2_-u4d0WfkrbaX4m95p5bpM.cache +1 -0
  135. data/test/dummy/tmp/cache/assets/sprockets/v3.0/BZ/BZI1tfK8XWUqOiMGYdRFiQKYl7PMprWPs1pK0XY3mc8.cache +0 -0
  136. data/test/dummy/tmp/cache/assets/sprockets/v3.0/C0/C0esC4G-fb2p7hprt-9S39DiIN4W1l4iKuOSwUuiwUw.cache +1 -0
  137. data/test/dummy/tmp/cache/assets/sprockets/v3.0/CD/CD9gffDM4E98omhQJsjzg6xRRk6_fs-R56iZ2sQ4vL8.cache +1 -0
  138. data/test/dummy/tmp/cache/assets/sprockets/v3.0/C_/C_qme5ZIsOxcxT7egM2uaUZq5sKZ3vpifRfr3NdQmgE.cache +0 -0
  139. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Cs/CsLYOm3owL5njEre0oZrp7rfrPozQcVxlvJXllD79_8.cache +0 -0
  140. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Cs/cssh8LbSeozd9EbLHLlTSUpZTJSfpY2vFuYuGvvN6yE.cache +1 -0
  141. data/test/dummy/tmp/cache/assets/sprockets/v3.0/DF/DFYEiUpyu7HMGnhXPzq0SZ-wq0lWhBdZ1miNtqtAPs8.cache +1 -0
  142. data/test/dummy/tmp/cache/assets/sprockets/v3.0/DS/DSOLSc6A5RVSmvM415eEWAWG_AgOvZcLZOXQjsXyWQA.cache +2 -0
  143. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dn/Dnv8Gzs8hr44x47oyjl6_Mn9Wzn7y6KQAK5qaf6XTkc.cache +0 -0
  144. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Dw/DwaaKb1E_ArCW1QSj8BIsyPgRx2Ot8-ocvnWmG4s9ck.cache +1 -0
  145. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EC/ECRUjKqajDEyRIx88Y6ERafwCdesNxlAM_92ShV_Tgg.cache +1 -0
  146. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EJ/EJFOUvkfmWWZV0z59Uq1iNi6OVgypgSkfu2d2_nD_5s.cache +1 -0
  147. data/test/dummy/tmp/cache/assets/sprockets/v3.0/FM/FM46Jcs768Lb9a48ghTA0LQJNDwtujqOVLfWipAgFKQ.cache +1 -0
  148. data/test/dummy/tmp/cache/assets/sprockets/v3.0/FM/FMW8J65N2k8BfLe2cnSh8RdkvQouhmIaVJ7R_1Q1lU4.cache +1 -0
  149. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fj/Fj9wk3WG0X_LuTI9jEPYY2HU5btm59aOpbx1afwZy4M.cache +3 -0
  150. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fj/fJS9bnzdUzO4XRNm42nD4ucpywK6n8k97YcbMskXcNk.cache +1 -0
  151. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fw/FwlpYy2-TCGlrxSo5QMF4A60GulM8lLAjKYa332fupY.cache +1 -0
  152. data/test/dummy/tmp/cache/assets/sprockets/v3.0/G1/G1UvsZ_neSlYn4W5UQPBOcxuLthPs2c-AuvCV9YwqtY.cache +2 -0
  153. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GG/GG8ZUpJCnNg9aJ9my2IqJ32HjWQkfkv6WN8oDt-QbDg.cache +1 -0
  154. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GN/GNLYFos2891NV-5hu9hU1ot7EPre76NwIGW1-Pu9a4s.cache +0 -0
  155. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Gq/Gq1-o99_FTAmMpHdVD2GREMHDUBchfuVdmACX8WsXZA.cache +0 -0
  156. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Gq/Gq6UUulKfqoSlmra4vAkq6bUoYLEM5iLi3vc1fFvfY0.cache +0 -0
  157. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Gr/GrcqYYXRV1kqMSYDgEfrXHVS_JjHuMkvzi7BV3AXlhw.cache +1 -0
  158. data/test/dummy/tmp/cache/assets/sprockets/v3.0/HH/HHObifnq0-OAXcTuneRXNow7cQMS3Wk7E4SJwOFg0zc.cache +1 -0
  159. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Hq/HqG4RuVapOFDc25JLHs38cERWY1xLOVRnCtDQMSyRck.cache +0 -0
  160. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ht/HtXaaU2BVfjuwJjUoVP2tD7Npl75B98VZJDwdE26hus.cache +0 -0
  161. data/test/dummy/tmp/cache/assets/sprockets/v3.0/I9/I9rlUp9wOGCFAgFJ5b8wQZoKKXE2J1-7hfje3UXsVZg.cache +0 -0
  162. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IE/IEMOkncj_U9_93eSMbALt9yao9LbDQLvq9n3fJ-_UOI.cache +0 -0
  163. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IQ/IQKKCtHbqJ6bUx8a4uVuxH0EnTMi3Z9pTGgf5evVhgI.cache +0 -0
  164. data/test/dummy/tmp/cache/assets/sprockets/v3.0/IQ/IqSIFKQlYMHc1EbDcAmi1u7TqGO04pv24COBQR-isa4.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ju/JuLeGTL8JaG5D9cyywHhb6IGinsNbD8yY6rbHWarK0Q.cache +1 -0
  166. data/test/dummy/tmp/cache/assets/sprockets/v3.0/KT/KTFy4DuyuDUx57JNP0W6fLLKCjxOWaeg7q17x5KDKfE.cache +0 -0
  167. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Kv/KvfeJal3RwHE_vFip-YDcfJf3hJYMDPzxHRPpXYqAQM.cache +0 -0
  168. data/test/dummy/tmp/cache/assets/sprockets/v3.0/L2/L2hU-WOXjHB0A8SrxDtNduvaKdwnjVQ03Z0oVziISHk.cache +0 -0
  169. data/test/dummy/tmp/cache/assets/sprockets/v3.0/L8/L88CHXoOVM-rgK33W0WiquqWq4DU9ZnngUlbj8DfAD8.cache +1 -0
  170. data/test/dummy/tmp/cache/assets/sprockets/v3.0/LU/LUtgCslJQspV1kEmCn_syNPA4ufxPaN6hMtWohaXsnw.cache +0 -0
  171. data/test/dummy/tmp/cache/assets/sprockets/v3.0/La/LaCGKPUclgb07zgHCjGbpLD2vFtFrpfguSA7NqS8AmY.cache +1 -0
  172. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ld/LdllFJg9rQqiqWy0nyDVm4M0WfryZupUWXbpLMcH4Hw.cache +1 -0
  173. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Le/LeJ8g5lhSV21E-CuvXvQ8qE0SdGx1kCj4bpzGm9FPBA.cache +0 -0
  174. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Le/LeUQdG0D7O4lxvySURbAaoGowjdY-WmNqf3Mfqrfxyg.cache +3 -0
  175. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ln/Lnfq5j_dOByDX6HFfH6v4CKkXwkD0y8rDlbKuSbI9v0.cache +1 -0
  176. data/test/dummy/tmp/cache/assets/sprockets/v3.0/NG/NGbUB1m2dRLO_AzYcl_oKkHdUuotDsIljodXXXwUFk8.cache +0 -0
  177. data/test/dummy/tmp/cache/assets/sprockets/v3.0/NK/NKeacgI5h_cOQhJQTmlh5l4Nn7d-6DKGYfBIJOSDUf4.cache +0 -0
  178. data/test/dummy/tmp/cache/assets/sprockets/v3.0/NL/NL1pFIPf2f5fuCvnoN5JF4kdGbWuHSLeeujGtqhfq6s.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/sprockets/v3.0/NT/NTFg7sX71FXGCXuBW1GUwf8uv47jZFRUrKLKIKO1Lcg.cache +0 -0
  180. data/test/dummy/tmp/cache/assets/sprockets/v3.0/NY/NYQt2UjSKo3RG_ugbqg590mhSB3mvP_gDHshzQmZVN8.cache +1 -0
  181. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nj/NjZsOGvtYC0KyMgW_b7qtcn-Ed3x2gqsRxAnG20VBMA.cache +0 -0
  182. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmvDTKFnq0WZO0lTY7shuZVZ35wQFx6JKventv2q0mE.cache +0 -0
  183. data/test/dummy/tmp/cache/assets/sprockets/v3.0/O3/O3rIEN4zKE7CJBM_LXwlKRJcqMURUwW_c0p9rsHJ3c8.cache +4 -0
  184. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OF/OFU_37H7M33hEEuzcANwdQAGfkk90oPeGIJwIHf5Xzw.cache +0 -0
  185. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +2 -0
  186. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Og/OgaMU4CNALgWmoD3psV4iD5JTmMxGGpfdcLkEDBrdKE.cache +1 -0
  187. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ol/OlTbAJQvBjcy3wv3CtTxLwTUCh23FReSq6n1cUQo7fU.cache +1 -0
  188. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ph/PhfCjJxri8GR-tRYNyZ4TGRxaqrQ2pVV7cLmqqow220.cache +1 -0
  189. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Pu/Pu1ZY6bHvgkdIneZmshfQMHO4lkdxTQGSzbUcbaR2JI.cache +0 -0
  190. data/test/dummy/tmp/cache/assets/sprockets/v3.0/QT/QTeSCu9r6R-LvVE6FvyfncwtlwuAd6YMS4u21lUHLRk.cache +0 -0
  191. data/test/dummy/tmp/cache/assets/sprockets/v3.0/QT/QTthbPiZXWJdfRab4l4_JZp54UB-wI9PjW7z-OCaoAE.cache +0 -0
  192. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qk/QkMmY41W78BAA7nXmfYlXDl4FxoPgBdMUe9e75nLSjo.cache +1 -0
  193. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qv/QvtydS7wcNNmB0KqFaQPpYZrpQgpm65pdcBVSI33zu8.cache +0 -0
  194. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qv/qvDrg1W-I6y2xd5FwQGH_yi4BuTNebLqv0_LV8j58EM.cache +0 -0
  195. data/test/dummy/tmp/cache/assets/sprockets/v3.0/RU/RU_ty9eUgt_HW5HIIBzVe38BmehTQI_vAwjDrsn10Tk.cache +1 -0
  196. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Re/ReGBPYTMVGc5UsM5L7KB0_3B13aNUqF-fsr2inoeNsE.cache +2 -0
  197. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rp/Rpto49Xq2Q5u3n6usxWXSE7maUSL5fmQ-rekahtllIo.cache +1 -0
  198. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rv/RvEZGaGPIB-UH7NiAS47UlEz6GUMuDdd2uMjmqMvT_I.cache +1 -0
  199. data/test/dummy/tmp/cache/assets/sprockets/v3.0/S0/S0isKtIfhNRYwge39yzW9XMD7da3RVY1yn5pTHUikF4.cache +0 -0
  200. data/test/dummy/tmp/cache/assets/sprockets/v3.0/S4/S4P4Inx4O6mCu-KXPCN98udBP2vvhoP_MSgP8Po1h2o.cache +1 -0
  201. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Sc/ScfD4iKc5jFQ0sAqQcZ5vbjFrMAx1y-jsiFmQJ5zA5w.cache +1 -0
  202. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Su/Su5U7lV7sSBp5h2drScqaxP09Dzgxf5TsLqhNmF7MGw.cache +1 -0
  203. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TG/TGXgExpgSc_VcKi1D8q4ny0qFNLn1zWiEPjuNlgqGg0.cache +0 -0
  204. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TY/TYeBLIUjWLMlTnDsI_NJkTmwTjGiTqpI9WwVtWKi58I.cache +1 -0
  205. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ti/TIAgcRehg3UoD7fAMwDtRPsueyHdM5FFRtTzk4XsGQQ.cache +1 -0
  206. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ti/TiVa3yvBS2xeFmOHVVJYGgoUnIfCCXcUFHMuet94wRY.cache +1 -0
  207. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tr/TrMavtlwXhgEVAvzNPfXmUqodHc3qmet6UGWf9d6zYE.cache +2 -0
  208. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UK/UKk4VLLLR7q9NN5ese2d_ncL-x9qK7UGBEgA5feD9lw.cache +2 -0
  209. data/test/dummy/tmp/cache/assets/sprockets/v3.0/U_/U_4FnN2FfvOfugPWddXzWbw4DHmvFBUs5OsmFiPkiOE.cache +3 -0
  210. data/test/dummy/tmp/cache/assets/sprockets/v3.0/U_/u_QoQJErsVSZi9Cw2JQlauHZuLy0Dq-vuvecsZDZ1E0.cache +0 -0
  211. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Uc/Uc_ZTiXMSqzZZrxwSXk_IoCOjRLxD7lDlcnjW9wvJH8.cache +1 -0
  212. data/test/dummy/tmp/cache/assets/sprockets/v3.0/V6/V6qz8Dc6vP1WFXSqLfkrrM9syWy5XgI2Gep62rW6-WA.cache +1 -0
  213. data/test/dummy/tmp/cache/assets/sprockets/v3.0/VE/VEjXe6wfJKIldWLaqz3ly5pWzsZiYn7JaY7r4XLB0T0.cache +1 -0
  214. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Wt/Wt2f-3IT2csmJ91fK6jFF2uDZnlQo6y1lszcBzEJyWc.cache +0 -0
  215. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Wt/wTcmxc80E-6PAz_V1hIWmNtN6nI0K8JQ1Rlc2BhL2C0.cache +1 -0
  216. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X2/X2U6mKd2lA8LOGF6n9qXkc0i2o7wScG89aOK_NS02kM.cache +1 -0
  217. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X2/x2m46SCZhw56dgfuvybJ3Ppq5sgz64fv8qu_4AW_LNU.cache +1 -0
  218. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XI/XI386_BkTj_gk7uXma5rbWR463wPft89TH5OjZKz2Tk.cache +1 -0
  219. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XL/XLgCehU5GSBGQhRots_0kKS4Pa9XkZOpu6Sol-YkfIo.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XP/XPe3HBxR_h-ROk5qu20EvkHvF__RvrLRxMbNd7eJ_3k.cache +0 -0
  221. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XX/XX3hVVDnv-sSVE7ZICha6u0NA3Ppl7l9JMSxEiPHaro.cache +0 -0
  222. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X_/X_8kAzLdAuIIE06x9RzFo6ZRCxuR6SBC3YcbGtmSel4.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X_/x_ocdNMbswM_QSPcMA3rCY6Pxc7oS6Su7URUZI-TfGw.cache +2 -0
  224. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xd/XDL5HGq0QRG8qEMjnfwd7KudUcAQ1gcfExvWOncMRw4.cache +1 -0
  225. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xd/Xds81p3ZkxCM7EL8FE-LA9pEP-vt1os11SHAUoQDRDU.cache +0 -0
  226. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xw/XwGalczmXLu1Vq7IES954Nt-bIUY_k-o0S4s_lK9QZc.cache +0 -0
  227. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Xw/XwJI5pHVYw-HuKwWYoeAcmr2nqtaXX2BUU0HLKDdLLI.cache +0 -0
  228. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y-/Y-idZQQ3EwCSVS2t83NHKq-6a5wCO-0qQOvEcoR1BH4.cache +3 -0
  229. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YH/YHoGfC96NRHhFDFox8URBfqr3RlMaZapY8R1ROROBCU.cache +0 -0
  230. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YO/YORomuSWaH9UIEZMS78MsLuQ5w_8EBj4BfT20cBhkys.cache +0 -0
  231. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YR/YR7MQVhcz2a_uFzIgpFRDgQdqZOFrP4mQ-TenZNV0ro.cache +1 -0
  232. data/test/dummy/tmp/cache/assets/sprockets/v3.0/YY/YYsopTTp0zAa8AARWHxyfNuNoWoMJFc_dLzdmmxAfQA.cache +1 -0
  233. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Yb/YbF4X3Fte6fTBitUAdknKND5C3WX2Ch9W_ic6gCnCls.cache +1 -0
  234. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Yt/Yts0Xj-C3Fz_x6WA2WM-QLeZNam3QuouYqVdekrfrAI.cache +2 -0
  235. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Z4/Z4szC9mPaIq-4GAc__koHEKpv7u7wHzKmsGzjRRuGUA.cache +0 -0
  236. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Z4/z4l1kUVK_V4Zxcw9GRbqWjgn6XfW_gT-shx4TXDhYBM.cache +0 -0
  237. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZS/ZSdczi_WgfcGf6T8pOIOP07xtYWzayAd1J8_oaYHlOI.cache +0 -0
  238. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Zf/ZfkqxFszjbVDAuZtXJpn-85YO1SjWn03Q3nCnUGEfGo.cache +1 -0
  239. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_9/_9G3bzAjv8L-5IO_zWzLO6TJ1LvBw-WCTrHLuupoJEI.cache +0 -0
  240. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_U/_Uj4WfSjcwp3Y4FaJyfTdk2YrFxpSn3PDfkTeHjdjYg.cache +0 -0
  241. data/test/dummy/tmp/cache/assets/sprockets/v3.0/_z/_z32ICcgsTGhMat-hSNJ1Zs_Z1mn-WcPlWanTuz4Mow.cache +0 -0
  242. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aZ/aZc1YG6XLLUwvwwAgNUs4_BuRePhg-Q7jKy5SzbxLos.cache +1 -0
  243. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bB/bBjejJEwZNPGlOwe3z3ij-Ioxpim5MBO2vIud8pOthQ.cache +0 -0
  244. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bF/bFzUPCp3h12jat2mDBKrknDhGIPGMzuPVGLTiifTxjA.cache +0 -0
  245. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bH/bHgt2eQnzB4T1PCAJuFLw3cZeUKoGJlaG0jkaXRMYWY.cache +0 -0
  246. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bS/bSgsBjtu-Y7WrxesKqith5xy2XjVTuWXEGghmr4rivk.cache +3 -0
  247. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bW/bWuyUVYXv1UBBeiimOQiJPa-Vll9LubPtXwDlinEcRk.cache +1 -0
  248. data/test/dummy/tmp/cache/assets/sprockets/v3.0/c9/c9cCA5h2e2lcRSB_xlgHVgaOZqVhIS-a9iRKPxbc3nM.cache +1 -0
  249. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cM/cMxRmRTWcm2kvRwccFPhgH4tv32a_nne4jKmUYtruqg.cache +1 -0
  250. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cN/cNbX5iq9BDETLU1py6kBl75t77IypeUadhFiqhLsNO0.cache +2 -0
  251. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cc/CcqQnWkWCnEIbpOgHRdAaNzFQHH2L9g6knBNJ3SB8lU.cache +1 -0
  252. data/test/dummy/tmp/cache/assets/sprockets/v3.0/cc/cclgnxezXL5bICYgKM8EP6CM79EuRWNYmvhurLSvfPs.cache +0 -0
  253. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ce/ceSV8XTFh63ZHKGJlbnwKXslFPqWLiY8SGXt31FiNTo.cache +0 -0
  254. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ct/ctE1aQULS9C0J9LB59jpqNJfxmYJGXrq6ANE_tmcP4w.cache +0 -0
  255. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dG/dGYZEYroVgmnLBXQCYz9zNmGxHkxAVAlVFzGz7jsx3c.cache +0 -0
  256. data/test/dummy/tmp/cache/assets/sprockets/v3.0/de/de3Kd5dAVorCW6CiFB0dV2OOzaXIm79lVwGIy2BxtzQ.cache +1 -0
  257. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dh/dhG6jJqObdFb7S-vtYoaF6UvajS_AB64R_oO7dc_njM.cache +1 -0
  258. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dj/djTNvveHgepJFppcIoTTO_8BSWfz7u8twGkyg2KGpgY.cache +0 -0
  259. data/test/dummy/tmp/cache/assets/sprockets/v3.0/dr/drSlN03pJucysB4B7eLkghrT9ZBDhpTorjwhsdNeBI0.cache +1 -0
  260. data/test/dummy/tmp/cache/assets/sprockets/v3.0/e5/e5YwXAH4M1cmeMnY4e4tPCtFAelF3e619Uo84a7O7qw.cache +1 -0
  261. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eW/eWmKSaV5eVYdVnRcCcqcBLObf13TOSuOvPqAXlJkr_4.cache +0 -0
  262. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eZ/eZT6zqDkMjGHFqgkwngj4RuZlg0d7hNJxKCPTaojD70.cache +0 -0
  263. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eZ/eZT_Zg0eETe2kp_kWdxpgQOMJEtjbLZaLiBsbTTYfkU.cache +2 -0
  264. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ed/ed_qL1hNVTKuXvmCCaf2fuu7m7wIpemGRzFKEKwhiEk.cache +1 -0
  265. data/test/dummy/tmp/cache/assets/sprockets/v3.0/el/elc1eh7AQtshCNx2BD4ycqBwwDW7l9W6_9PSSfkdRZw.cache +1 -0
  266. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fO/fO22bQR4zM1-2bL5N3pMbYD6T8THJlzF8ChIIHiaV-c.cache +0 -0
  267. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fc/FCuilTOjA7atfSufnrJX7rHLcHVldAsQklmbgS2K-Os.cache +0 -0
  268. data/test/dummy/tmp/cache/assets/sprockets/v3.0/fc/fc49oE4sEETUNfi1q8ZjoBeAcwLlvrEUzN68YeBjdjM.cache +0 -0
  269. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ff/fF9GeK3y-65UhLrBd8gYyq5L3H9y4DHSHzMi6W7AU_w.cache +0 -0
  270. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ff/fF9VNsPFiwDEC4rlfFZxrYi9ZuVSRxSGC239k2h7qlk.cache +0 -0
  271. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ff/ff7iuOPVuvIGaVlIDs79qbQLLmR2KRB6iUrUUWoSSjU.cache +0 -0
  272. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ff/ffk-E0APeP-Ba5zsRy44pUjUV9_9ShJ4RbybLboXE4M.cache +0 -0
  273. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gA/gAn10cGy83oA1g2JKW58awG5trLrLnB6UIYxml3uhMA.cache +0 -0
  274. data/test/dummy/tmp/cache/assets/sprockets/v3.0/gZ/gZp3uXMHuYQC4hzCr7bQfetKNdJAtbQmg3so2KpW1Dw.cache +2 -0
  275. data/test/dummy/tmp/cache/assets/sprockets/v3.0/h1/h143Swzrfuh5r0KHuGUjGD5LmT9EuJGM0W2KFNAS87Q.cache +2 -0
  276. data/test/dummy/tmp/cache/assets/sprockets/v3.0/h2/h2iaYlKrq06cFKZ7RQE4yO3RGYAda_9NsUhxeRtlg68.cache +0 -0
  277. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +2 -0
  278. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iJ/iJLso_yKSb6XJZsoDo7hHBcpRCC6WrB9WGAblrHWB50.cache +1 -0
  279. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iJ/ijx4sr3F1vZzflIRPBnzGEOqCPOAxP5E1XENMzG4qSw.cache +0 -0
  280. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iV/iVEtAXTWK7twmY_U5Gp5lP0L1zqbiBjDI9bKymw5wQQ.cache +0 -0
  281. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iu/iu55c1ZNdMMG-wfBFNaDN64hBxQIuolrHPe3Dhg8AoQ.cache +0 -0
  282. data/test/dummy/tmp/cache/assets/sprockets/v3.0/j1/j1VJa8Bm4H7QML4QCgCWdo5og8MUvlO6JIePMi9quxY.cache +0 -0
  283. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jJ/jJDfuKEIKaO4anc9amIMj5VRHSVfIDAIl3IMdUHeJ68.cache +1 -0
  284. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jM/jMygXqKrCCOEXGW6nU0CBhLl3_OdGlDfZGSzljVp9cw.cache +0 -0
  285. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jQ/jQRLSAj2sB6Mor5MY9RcCOJvfqpYMY1MwpkArnwbaNg.cache +1 -0
  286. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jg/jgUQwSKVupdt_LM1yzMI9sPa7bUS0hL5NYF_7PDlQZ4.cache +0 -0
  287. data/test/dummy/tmp/cache/assets/sprockets/v3.0/jw/jw64rIhCrdvowVxQ3lSeqlBy9KNUZti1emiuiVLaD6I.cache +0 -0
  288. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kB/kBs_Zv3NgQPG_Erg_0aTHKPfGN6pTim3ZA2gfj6lXOI.cache +1 -0
  289. data/test/dummy/tmp/cache/assets/sprockets/v3.0/kN/kNbCCN-jnLMUnSRHdZYZm8J0LRr7DObseTCm0iqNSvI.cache +0 -0
  290. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/lYX9apLRCeLVEQmZpPWPEVXX4fJbvCd1kwP--mCVLEU.cache +0 -0
  291. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lc/lcUuxX1kQ2pqBCSae7T757ZBrLC-kykZBzE_IeI1P9Q.cache +0 -0
  292. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lw/lwwQcg5LmgQzJk92PReGYykEm8Ro33bIc8H9kAZfQ0c.cache +0 -0
  293. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mf/mfSQliTMKdSX9o54w2Cekfmthv8R7QNOhRC-9Ofvhs8.cache +1 -0
  294. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mg/mgepIPH6FskFYPupUwR2zar-vPVmTj21YF5mrDoAbJk.cache +0 -0
  295. data/test/dummy/tmp/cache/assets/sprockets/v3.0/n2/n2RGsvZoKBxTiLhLJbX7VfPN_q3ki9fSDLKpTg9Qpag.cache +1 -0
  296. data/test/dummy/tmp/cache/assets/sprockets/v3.0/nv/nv353JHGANla93EeXt0nbNR7q6Fc_k-Cww2sm0XLO3I.cache +1 -0
  297. data/test/dummy/tmp/cache/assets/sprockets/v3.0/oX/oX6o-19Y6MZIzE5WBT20iflpYRQ5lxqOP46WbSkrswk.cache +1 -0
  298. data/test/dummy/tmp/cache/assets/sprockets/v3.0/p-/p-YGCQ4ATLB9KhNUf6SaCWeDSi-hF25M4tlEw6wL-Tc.cache +1 -0
  299. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pE/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +2 -0
  300. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pZ/Pz22fzMNr_4S5LTu_F4aHvfLwi3a5FxWzKSB7Ih0uo4.cache +1 -0
  301. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pZ/pZeDBpX8uYaZQSL8QFb81jahqzVveXCr7-tkG1_QFMQ.cache +0 -0
  302. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pm/PmCDqEeLtrPfP2wF8MwUzaxxNP-9uAs2z6H7nT15ZT4.cache +1 -0
  303. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pm/pm0Z0fr1Ng6EPwmdfw1xn3hB0ErARZuc72vQFgPXMa4.cache +1 -0
  304. data/test/dummy/tmp/cache/assets/sprockets/v3.0/px/pxxnRt2S5YKvr89tE4B2uqWKSn_tzX2iMKaKc-L3mp0.cache +0 -0
  305. data/test/dummy/tmp/cache/assets/sprockets/v3.0/py/pyeQCwCKcTKGdUT-hUoQTeAaNBcmz9IX6ytzEOVTIRE.cache +0 -0
  306. data/test/dummy/tmp/cache/assets/sprockets/v3.0/qc/qc_xczyLqAbmyMs6ToF9Yh5Y0oCPIQjLpzHiq63LWiw.cache +0 -0
  307. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rK/rKfAjDHfXPWkuIQgDFeROxJHcCrAS-6Cu_LzqEP_tY4.cache +3 -0
  308. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rQ/rQLidlmBnkrRwbSwBT8TFpss6O0RI5eBRgIqAAf7I9w.cache +0 -0
  309. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rd/rdeyGdg6nFOlk7mcLZ1v48IshJec5MYarn6wtVbTlbw.cache +1 -0
  310. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ri/ricj8G0pRbsatr9A6Ntp6UXo-EqVDghl9E_UaFnWyDI.cache +1 -0
  311. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rn/rnOtD1XvKuRcZD61y_olzgHQlxMJKFpADr46croj5r8.cache +1 -0
  312. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rs/rs29jYXdRVDaE8LFpPP5sue1m6VBOjzSSSmbj3w0R7g.cache +3 -0
  313. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ry/rygDWHz1u7v_E5X8f25Ls13ig8RrWj7AZdXJdO-Bq6Q.cache +1 -0
  314. data/test/dummy/tmp/cache/assets/sprockets/v3.0/s7/s7c54SRRAn01lzB0-C1BGaqZ6RMq3nyMAia0CyZND5k.cache +0 -0
  315. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sL/sLnioaoEAvcd1PA7DFF87-07iqZ7kMmomeiMvkhw6No.cache +0 -0
  316. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sO/sO6cCZ8-40-uH9Q3VQwsuEzFIrVAf5uFyOa-DLD196g.cache +0 -0
  317. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sz/szmBNR1H1DygmcGPID8zNIcbmrO1vGqzHYRGuc5u7-c.cache +3 -0
  318. data/test/dummy/tmp/cache/assets/sprockets/v3.0/t5/t5yKLDb-oJrmM6EidUDDJ9htZXQRF_hTMBXD1A53RBs.cache +0 -0
  319. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tL/tLjAgIG8H6aT1yoSACGN9wfOA8P1Arys2JKZkVGmNXQ.cache +0 -0
  320. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tU/tU-Tu9-noE-IHLvRNqvK_woXM1aNYteaOPgUhxs6YLU.cache +3 -0
  321. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tW/tW8xtl_kBfnL8qfbu3og68_AnXJ7YupNE6BEDPPFTsw.cache +0 -0
  322. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tb/TBsC0J-09bPcPCk5aGUFhdmusxLwiGyIegmawsB3xjw.cache +0 -0
  323. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tb/tb2EHpruj_NKnlrPA8noFSH5EtqZCqBhcaFC-BVAzp0.cache +0 -0
  324. data/test/dummy/tmp/cache/assets/sprockets/v3.0/th/thEXJAStDw_NJ0oW4BatqUB4NUovgmzLYjQpoGmnt_M.cache +1 -0
  325. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tq/tqXoYuJiHJnkCpau1HYEYtY2-wDz7t8r5iGWAbGMlu0.cache +3 -0
  326. data/test/dummy/tmp/cache/assets/sprockets/v3.0/u0/U01H5dfrMbux5GogbLyC4SBOGndzsyFaj1Tvt-x_MTM.cache +1 -0
  327. data/test/dummy/tmp/cache/assets/sprockets/v3.0/u0/u05ODfGMQPjYzkiqtypQN02wNjb1TOsdM4nA6N0Gh7U.cache +1 -0
  328. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vQ/vQtYbe1XWQpkoH7AsCmn3Vg90HK8gBHJWMr-OE_Yzbg.cache +1 -0
  329. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vX/vXIuktNgDrPy8Z26iigTe5KzkVH0MLWnU_tO7fOcuQY.cache +1 -0
  330. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vi/vikgCXTfdSo0-dQ8npKdHUscpgFEvOuH8yl4kh8sg1g.cache +0 -0
  331. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vu/vuwwEKj3Pn9TBEpVl120M_XgalUJIHxkg8ki2A6V6Sk.cache +0 -0
  332. data/test/dummy/tmp/cache/assets/sprockets/v3.0/vv/vvXsHOAgAUjJPzD2Uk0jFgsQ-q9SPSBAwKypglmyo9o.cache +1 -0
  333. data/test/dummy/tmp/cache/assets/sprockets/v3.0/w2/w2nxaML0A06iskoPgzyx7IkuH7eTgBz9pOScOPROVng.cache +0 -0
  334. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wp/wpXO5iYAIrHziTkLjpJ0fLFEWA20vjlc-zodbcbXrXI.cache +1 -0
  335. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ww/wwyHZev8ZI64E4ZkAEQrGUwshw5Q5Pg0SXp5Q7EiMME.cache +0 -0
  336. data/test/dummy/tmp/cache/assets/sprockets/v3.0/x3/x3ugZrAsFu-SoYrFZ3QESK2Bv-n0twnYh7MfrC2ei5A.cache +4 -0
  337. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xE/xEt1J9sNcPPTzLnqYdO0cwcxIKiiNUvbOX1XjY4mOwQ.cache +4 -0
  338. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xO/xOHSvfsoDwJ31vBs7MeJSpnZXhYmahjbpoBruNFMSTw.cache +1 -0
  339. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xR/xRo_XLPpPL6rw8FynKSmB1jbUF4U4sdFfa9qlFEaV-M.cache +1 -0
  340. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xb/XB6BuL_-MlRJw35sb8y-MuMukKnImXWF3tM7s5NXTCs.cache +0 -0
  341. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xb/xbDqy_ABKyvnDx5qFb7bOefr2mRNtkJS6jxgaK2mymE.cache +1 -0
  342. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yE/yE-vYTftOCvTjiXwsSaPhc68Ok3Swuj7FeHDt0X1fuY.cache +0 -0
  343. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yW/yWhGG9UHY-eITiHpveUgL7MEefJBaJeb69K-sfnafHk.cache +0 -0
  344. data/test/dummy/tmp/cache/assets/sprockets/v3.0/yv/yvDUKhKfIJ7Mzn3EKrWjn7dUzISDvjV7NdAZHQb2e4k.cache +1 -0
  345. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zE/zEyHh8U1s_vyFT8TKnThlXAwgkQTZilKRZijXrGmXZQ.cache +1 -0
  346. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zQ/zQfrKzck6RKqYFUfKWT4m168XkPB0bFfxD-vJFHwzBs.cache +3 -0
  347. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zd/ZdNzirUsmGWTgLcSe08uPLwZHnzZS6fglg2UXqiZHCQ.cache +0 -0
  348. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zd/zduZXmFNo0y1enN7_NdRVQRkSq5Ig0zd-ISOx8rZJac.cache +1 -0
  349. data/test/kadmin/form_test.rb +6 -0
  350. data/test/test_helper.rb +32 -0
  351. metadata +794 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef82febec75e4f5da3d104ec4b9e1e87316154d2
4
+ data.tar.gz: e99e55d0d3d5b7b4b8c355eaeaa5a2fcab22e2a1
5
+ SHA512:
6
+ metadata.gz: 152316ddf56a8c6422137f1a492bf334e0d99a40d0debde4c9a66fd3cbde3a96976c2a09f5aef2802c46a62e740fa6da2a2184e11a036c0e5ebeafff3c813fff
7
+ data.tar.gz: a1b630f7e7a0f4d8ccb8cf163a5a4220015e628f8ab4a7775b472144c088af0fde55663147cdc8c66fad2032262b7159038f4d46183d68a701143b9f1440a0e0
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Kadmin
2
+
3
+ [![GitHub release](https://img.shields.io/badge/release-0.1.4-blue.png)](https://github.com/barcoo/kadmin/releases/tag/0.1.4)
4
+
5
+ Collection of utility, configuration, etc., for admin areas in different projects.
6
+
7
+ ## Installation
8
+
9
+ Add to your gemfile:
10
+
11
+ ```ruby
12
+ gem 'kadmin', git: 'git@github.com:barcoo/kadmin.git'
13
+ ```
14
+
15
+ ## Web
16
+
17
+ If you wish to use the web front-end, make sure to ```require 'kadmin'```
18
+
19
+ See the test application ```test/dummy``` for more info.
20
+
21
+ ## Development
22
+
23
+ Clone, bundle install
24
+
25
+ Make sure test coverage stays > 90%, and make sure ```master``` stays green.
26
+
27
+ ## Release
28
+
29
+ ___Note___: eventually use one of the popular git release scripts to tag, create tag notes, etc., based on git changelog.
30
+
31
+ When you want to create a new release, use the rake task ```cim:release``` (in the main Rakefile)
32
+
33
+ ```shell
34
+ bundle exec rake cim:release
35
+ ```
data/Rakefile ADDED
@@ -0,0 +1,146 @@
1
+ require 'english'
2
+
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
10
+ load 'rails/tasks/engine.rake'
11
+ load 'rails/tasks/statistics.rake'
12
+
13
+ Bundler::GemHelper.install_tasks
14
+
15
+ require 'rake/testtask'
16
+
17
+ Rake::TestTask.new(:test) do |t|
18
+ t.libs << 'lib'
19
+ t.libs << 'test'
20
+ t.pattern = 'test/**/*_test.rb'
21
+ t.verbose = false
22
+ end
23
+
24
+ task default: :test
25
+
26
+ require 'yard'
27
+
28
+ YARD::Rake::YardocTask.new do |t|
29
+ t.files = ['lib/**/*.rb', 'app/**/*.rb', 'config/**/*.rb']
30
+ t.options = ['--output-dir=./docs']
31
+ end
32
+
33
+ require 'kadmin/version'
34
+
35
+ namespace :cim do
36
+ desc 'Tags, updates README, and CHANGELOG and pushes to Github. Requires ruby-git'
37
+ task :release do
38
+ tasks = ['cim:assert_clean_repo', 'cim:git_fetch', 'cim:set_new_version', 'cim:update_readme', 'cim:update_changelog', 'cim:commit_changes', 'cim:tag']
39
+ begin
40
+ tasks.each { |task| Rake::Task[task].invoke }
41
+ `git push && git push origin '#{Kadmin::VERSION}'`
42
+ rescue => error
43
+ puts ">>> ERROR: #{error}; might want to reset your repository"
44
+ end
45
+ end
46
+
47
+ desc 'Fails if the current repository is not clean'
48
+ task :assert_clean_repo do
49
+ status = `git status -s`.chomp.strip
50
+ if status.strip.empty?
51
+ status = `git log origin/master..HEAD`.chomp.strip # check if we have unpushed commits
52
+ if status.strip.empty?
53
+ puts '>>> Repository is clean!'
54
+ else
55
+ puts '>>> Please push your committed changes before releasing!'
56
+ exit(-1)
57
+ end
58
+ else
59
+ puts '>>> Please stash or commit your changes before releasing!'
60
+ exit(-1)
61
+ end
62
+ end
63
+
64
+ desc 'Fetches latest tags/commits'
65
+ task :git_fetch do
66
+ puts '>>> Fetching latest git refs'
67
+ `git fetch --tags`
68
+ end
69
+
70
+ desc 'Requests the new version number'
71
+ task :set_new_version do
72
+ STDOUT.print(">>> New version number (current: #{Kadmin::VERSION}; leave blank if already updated): ")
73
+ input = STDIN.gets.strip.tr("'", "\'")
74
+
75
+ current = if input.empty?
76
+ Kadmin::VERSION
77
+ else
78
+ unless input =~ /[0-9]+\.[0-9]+\.[0-9]+/
79
+ puts '>>> Please use semantic versioning!'
80
+ exit(-1)
81
+ end
82
+
83
+ input
84
+ end
85
+
86
+ latest = `git describe --abbrev=0`.chomp.strip
87
+ unless Gem::Version.new(current) > Gem::Version.new(latest)
88
+ puts ">>> Latest tagged version is #{latest}; make sure gem version (#{current}) is greater!"
89
+ exit(-1)
90
+ end
91
+
92
+ if !input.empty?
93
+ `sed -i -u "s@VERSION = '#{Kadmin::VERSION}'@VERSION = '#{input}'@" #{File.expand_path('../lib/kadmin/version.rb', __FILE__)}`
94
+ $VERBOSE = nil
95
+ Kadmin.const_set('VERSION', input)
96
+ $VERBOSE = false
97
+
98
+ `bundle check` # force updating version
99
+ end
100
+ end
101
+
102
+ desc 'Updates README with latest version'
103
+ task :update_readme do
104
+ puts '>>> Updating README.md'
105
+ replace = %([![GitHub release](https://img.shields.io/badge/release-#{Kadmin::VERSION}-blue.png)](https://github.com/barcoo/kadmin/releases/tag/#{Kadmin::VERSION}))
106
+
107
+ `sed -i -u 's@^\\[\\!\\[GitHub release\\].*$@#{replace}@' README.md`
108
+ end
109
+
110
+ desc 'Updates CHANGELOG with commit log from last tag to this one'
111
+ task :update_changelog do
112
+ puts '>>> Updating CHANGELOG.md'
113
+ latest = `git describe --abbrev=0`.chomp.strip
114
+ range = $CHILD_STATUS.success? && !latest.empty? ? "'#{latest}'..HEAD" : ''
115
+
116
+ log = `git log --pretty=format:'- [%h](https://github.com/barcoo/kadmin/commit/%h) *%ad* __%s__ (%an)' --date=short #{range}`.chomp
117
+
118
+ changelog = File.open('.CHANGELOG.md', 'w')
119
+ changelog.write("# Changelog\n\n###{Kadmin::VERSION}\n\n#{log}\n\n")
120
+ File.open('CHANGELOG.md', 'r') do |file|
121
+ file.readline # skip first two lines
122
+ file.readline
123
+
124
+ while buffer = file.read(2048) # rubocop: disable Lint/AssignmentInCondition
125
+ changelog.write(buffer)
126
+ end
127
+ end
128
+
129
+ changelog.close
130
+ `mv '.CHANGELOG.md' 'CHANGELOG.md'`
131
+ end
132
+
133
+ desc 'Commits the README/CHANGELOG changes'
134
+ task :commit_changes do
135
+ puts '>>> Committing updates to README/CHANGELOG'
136
+ `git commit -am'Updated README.md and CHANGELOG.md on new release'`
137
+ end
138
+
139
+ desc 'Creates and pushes the tag to git'
140
+ task :tag do
141
+ puts '>>> Tagging'
142
+ STDOUT.print('>>> Please enter a tag message: ')
143
+ input = STDIN.gets.strip.tr("'", "\'")
144
+ `git tag -a '#{Kadmin::VERSION}' -m '#{input}'`
145
+ end
146
+ end
@@ -0,0 +1,3 @@
1
+ //= require jquery2
2
+ //= require jquery_ujs
3
+ //= require bootstrap
@@ -0,0 +1,50 @@
1
+ // Custom bootstrap variables must be set or import before bootstrap itself.
2
+ @import "bootstrap-sprockets";
3
+ @import "bootstrap";
4
+
5
+ a.thumbnail {
6
+ max-width: 100%;
7
+ overflow: hidden;
8
+ padding-bottom: 2px;
9
+ }
10
+
11
+ a.thumbnail > img {
12
+ max-width: 100%;
13
+ padding-bottom: 2px;
14
+ }
15
+
16
+ table.table-borderless {
17
+
18
+ }
19
+
20
+ table.table-borderless {
21
+ tr, td, th {
22
+ border-width: 0;
23
+ border-style: none !important;
24
+ }
25
+ }
26
+
27
+ .content {
28
+ height: 100%;
29
+ left: 0;
30
+ min-height: 100%;
31
+ padding-bottom: 1em;
32
+ width: 100%;
33
+
34
+ .row {
35
+ height: 100%;
36
+ }
37
+
38
+ .main {
39
+ .page-header {
40
+ margin-top: 0;
41
+ }
42
+ }
43
+
44
+ .sidebar {
45
+ }
46
+
47
+ .alerts {
48
+ margin: 1em auto;
49
+ }
50
+ }
@@ -0,0 +1,2 @@
1
+ @import "select2";
2
+ @import "select2-bootstrap";
@@ -0,0 +1,58 @@
1
+ module Kadmin
2
+ class ApplicationController < ActionController::Base
3
+ layout 'kadmin/application'
4
+
5
+ helper Kadmin::ApplicationHelper
6
+ helper Kadmin::BootstrapHelper
7
+ helper Kadmin::NavigationHelper
8
+ helper Kadmin::PaginationHelper
9
+
10
+ include Kadmin::Concerns::AuthorizedUser
11
+
12
+ before_action :authorize
13
+ before_action :set_navbar_links
14
+ before_action :set_default_format
15
+
16
+ # @!group Error Handling
17
+
18
+ unless defined?(BetterErrors)
19
+ rescue_from StandardError, with: :handle_error
20
+ rescue_from ActiveRecord::RecordNotFound, with: :not_found
21
+ rescue_from ActionController::ParameterMissing, with: :params_missing
22
+ end
23
+
24
+ def params_missing(error)
25
+ handle_error(error, title: I18n.t('kadmin.errors.params_missing'), status: :bad_request)
26
+ end
27
+
28
+ def not_found(error)
29
+ handle_error(error, title: I18n.t('kadmin.errors.not_found'), status: :not_found)
30
+ end
31
+
32
+ def handle_error(error, options = {})
33
+ options = {
34
+ title: error.try(:title) || error.class.name,
35
+ message: error.message,
36
+ status: :internal_server_error
37
+ }.merge(options)
38
+ render 'kadmin/error', status: options[:status], locals: options
39
+ end
40
+
41
+ # @!endgroup
42
+
43
+ # @!group Helpers
44
+
45
+ # Overload in the sub-controllers to set up the links in the layout
46
+ def set_navbar_links
47
+ @layout_navbar_links = []
48
+ end
49
+ protected :set_navbar_links
50
+
51
+ def set_default_format
52
+ params[:format] = 'html' if params[:format].blank?
53
+ end
54
+ protected :set_default_format
55
+
56
+ # @!endgroup
57
+ end
58
+ end
@@ -0,0 +1,98 @@
1
+ module Kadmin
2
+ class AuthController < Kadmin::ApplicationController
3
+ SESSION_KEY = 'kadmin.user'.freeze
4
+
5
+ # Don't try to authenticate user on the authentication controller...
6
+ skip_before_action :authorize
7
+
8
+ # @!group Endpoints
9
+ # GET /auth/login
10
+ def login
11
+ render 'kadmin/auth/login'
12
+ end
13
+
14
+ # GET /auth/logout
15
+ # DELETE /auth/logout
16
+ def logout
17
+ session.delete(SESSION_KEY)
18
+ redirect_to action: :login
19
+ end
20
+
21
+ # GET /auth/:provider/callback
22
+ # POST /auth/:provider/callback
23
+ def save
24
+ auth_hash = request.env['omniauth.auth']
25
+
26
+ if auth_hash.blank?
27
+ Kadmin.logger.error('No authorization hash provided')
28
+ flash.alert = I18n.t('kadmin.auth.error')
29
+ redirect_to action: :login
30
+ return
31
+ end
32
+
33
+ email = auth_hash.dig('info', 'email')
34
+ if Kadmin::Auth.users.exists?(email)
35
+ session[SESSION_KEY] = email
36
+ redirect_url = request.env['omniauth.origin']
37
+ redirect_url = Kadmin.config.mount_path unless valid_redirect_url?(redirect_url)
38
+ else
39
+ flash.alert = I18n.t('kadmin.auth.unauthorized_message')
40
+ redirect_url = url_for(action: :login)
41
+ end
42
+
43
+ redirect_to redirect_url
44
+ end
45
+
46
+ # GET /auth/failure
47
+ def failure
48
+ flash.alert = params[:message]
49
+ redirect_to action: :login
50
+ end
51
+
52
+ def unauthorized
53
+ render 'kadmin/error', format: ['html'], locals: {
54
+ title: I18n.t('kadmin.auth.unauthorized'),
55
+ message: I18n.t('kadmin.auth.unauthorized_message')
56
+ }
57
+ end
58
+
59
+ # @!endgroup
60
+
61
+ # @!group Helpers
62
+
63
+ def valid_redirect_url?(url)
64
+ valid = false
65
+
66
+ unless url.blank?
67
+ paths = [url_for(action: :login), url_for(action: :logout)]
68
+ valid = paths.none? { |invalid| url == invalid }
69
+ end
70
+
71
+ return valid
72
+ end
73
+ protected :valid_redirect_url?
74
+
75
+ def omniauth_provider_link
76
+ auth_prefix = "#{Kadmin.config.mount_path}/auth"
77
+ provider_link = "#{auth_prefix}/#{Kadmin::Auth.omniauth_provider}"
78
+ origin = params[:origin]
79
+
80
+ # if the referer is a auth route, then we risk ending in an endless loop
81
+ if origin.blank?
82
+ referer = request.referer
83
+ if referer.blank?
84
+ origin = Kadmin.config.mount_path
85
+ else
86
+ uri = URI(referer)
87
+ origin = referer unless uri&.path&.start_with?(auth_prefix)
88
+ end
89
+ end
90
+
91
+ provider_link = "#{provider_link}?origin=#{CGI.escape(origin)}" unless origin.blank?
92
+ return provider_link
93
+ end
94
+ helper_method :omniauth_provider_link
95
+
96
+ # @!endgroup
97
+ end
98
+ end
@@ -0,0 +1,67 @@
1
+ module Kadmin
2
+ module Concerns
3
+ module AuthorizedUser
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ if respond_to?(:helper_method)
8
+ helper_method :current_user
9
+ helper_method :authorized_user
10
+ helper_method :logged_in?
11
+ helper_method :authorized?
12
+ end
13
+ end
14
+
15
+ # @!group before_action
16
+
17
+ # Add as a before_action whenever you wish to authorize a user for a particular
18
+ # resource. The app provided user model will perform authorization of the resource.
19
+ # @see Kadmin::Auth::User
20
+ # @example
21
+ # before_action :authorize, except: [:index] # exclude index from authorization
22
+ def authorize
23
+ if Kadmin::Auth.config.enabled?
24
+ if logged_in?
25
+ unless authorized?
26
+ redirect_to Kadmin::Engine.routes.url_helpers.auth_unauthorized_path
27
+ end
28
+ else
29
+ redirect_to Kadmin::Engine.routes.url_helpers.auth_login_path(origin: request.path)
30
+ end
31
+ end
32
+ end
33
+
34
+ # @!endgroup
35
+
36
+ # @!group View Helpers
37
+
38
+ # @return [String] the current user identifier. Historically called current_user
39
+ def current_user
40
+ session[Kadmin::AuthController::SESSION_KEY]
41
+ end
42
+
43
+ # @see Kadmin::Concerns::AuthorizedUser#current_user
44
+ # @return [Kadmin::Auth::User] instance of the user identified by current_user
45
+ def authorized_user
46
+ return Kadmin::Auth.users.get(current_user)
47
+ end
48
+
49
+ # @!endgroup
50
+
51
+ # @!group Helpers
52
+
53
+ # @return [Boolean] true if the user is logged in, false otherwise
54
+ def logged_in?
55
+ return current_user.present?
56
+ end
57
+
58
+ # @see Kadmin::Auth::User
59
+ # @return [Boolean] true if the user is authorized in, false otherwise
60
+ def authorized?
61
+ return authorized_user&.authorized?(request)
62
+ end
63
+
64
+ # @!endgroup
65
+ end
66
+ end
67
+ end