wobauth 3.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +165 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/wobauth/admin.js +13 -0
- data/app/assets/javascripts/wobauth/authorities.js.coffee +31 -0
- data/app/assets/javascripts/wobauth/groups.js +2 -0
- data/app/assets/javascripts/wobauth/memberships.js +2 -0
- data/app/assets/javascripts/wobauth/roles.js +2 -0
- data/app/assets/stylesheets/wobauth/application.css +15 -0
- data/app/assets/stylesheets/wobauth/authorities.css +4 -0
- data/app/assets/stylesheets/wobauth/groups.css +4 -0
- data/app/assets/stylesheets/wobauth/memberships.css +4 -0
- data/app/assets/stylesheets/wobauth/roles.css +4 -0
- data/app/controllers/wobauth/ad_users_controller.rb +24 -0
- data/app/controllers/wobauth/application_controller.rb +25 -0
- data/app/controllers/wobauth/authorities_controller.rb +88 -0
- data/app/controllers/wobauth/groups/authorities_controller.rb +11 -0
- data/app/controllers/wobauth/groups/memberships_controller.rb +11 -0
- data/app/controllers/wobauth/groups_controller.rb +60 -0
- data/app/controllers/wobauth/login_controller.rb +10 -0
- data/app/controllers/wobauth/memberships_controller.rb +79 -0
- data/app/controllers/wobauth/registrations_controller.rb +26 -0
- data/app/controllers/wobauth/roles_controller.rb +30 -0
- data/app/controllers/wobauth/users/authorities_controller.rb +11 -0
- data/app/controllers/wobauth/users/memberships_controller.rb +11 -0
- data/app/controllers/wobauth/users_controller.rb +76 -0
- data/app/helpers/wobauth/ad_users_helper.rb +60 -0
- data/app/helpers/wobauth/application_helper.rb +53 -0
- data/app/helpers/wobauth/authorities_helper.rb +9 -0
- data/app/models/wobauth/ad_user.rb +4 -0
- data/app/models/wobauth/admin_ability.rb +67 -0
- data/app/models/wobauth/authority.rb +17 -0
- data/app/models/wobauth/group.rb +18 -0
- data/app/models/wobauth/membership.rb +11 -0
- data/app/models/wobauth/role.rb +19 -0
- data/app/models/wobauth/user.rb +11 -0
- data/app/services/wobauth/search_ad_user_service.rb +53 -0
- data/app/views/devise/registrations/edit.html.erb +25 -0
- data/app/views/devise/sessions/new.html.erb +17 -0
- data/app/views/devise/shared/_links.html.erb +0 -0
- data/app/views/wobauth/ad_users/index.html.erb +69 -0
- data/app/views/wobauth/authorities/_form.html.erb +32 -0
- data/app/views/wobauth/authorities/edit.html.erb +1 -0
- data/app/views/wobauth/authorities/index.html.erb +41 -0
- data/app/views/wobauth/authorities/new.html.erb +1 -0
- data/app/views/wobauth/authorities/show.html.erb +45 -0
- data/app/views/wobauth/groups/_form.html.erb +20 -0
- data/app/views/wobauth/groups/_group_memberships.html.erb +21 -0
- data/app/views/wobauth/groups/_group_roles.html.erb +23 -0
- data/app/views/wobauth/groups/edit.html.erb +1 -0
- data/app/views/wobauth/groups/index.html.erb +31 -0
- data/app/views/wobauth/groups/new.html.erb +1 -0
- data/app/views/wobauth/groups/show.html.erb +45 -0
- data/app/views/wobauth/memberships/_form.html.erb +20 -0
- data/app/views/wobauth/memberships/edit.html.erb +1 -0
- data/app/views/wobauth/memberships/index.html.erb +33 -0
- data/app/views/wobauth/memberships/new.html.erb +1 -0
- data/app/views/wobauth/memberships/show.html.erb +28 -0
- data/app/views/wobauth/roles/_role_authorities.html.erb +21 -0
- data/app/views/wobauth/roles/index.html.erb +26 -0
- data/app/views/wobauth/roles/show.html.erb +18 -0
- data/app/views/wobauth/shared/_accounting.html.erb +25 -0
- data/app/views/wobauth/shared/_admin.html.erb +13 -0
- data/app/views/wobauth/users/_form.html.erb +28 -0
- data/app/views/wobauth/users/_user_groups.html.erb +22 -0
- data/app/views/wobauth/users/_user_roles.html.erb +23 -0
- data/app/views/wobauth/users/edit.html.erb +1 -0
- data/app/views/wobauth/users/index.html.erb +52 -0
- data/app/views/wobauth/users/new.html.erb +1 -0
- data/app/views/wobauth/users/show.html.erb +130 -0
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/devise.rb +260 -0
- data/config/initializers/devise_failure_app.rb +21 -0
- data/config/initializers/simple_form.rb +169 -0
- data/config/initializers/simple_form_bootstrap.rb +154 -0
- data/config/initializers/wobapphelpers.rb +18 -0
- data/config/locales/de.yml +80 -0
- data/config/locales/devise.de.yml +60 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/en.yml +27 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/locales/wobapphelpers.de.yml +10 -0
- data/config/locales/wobapphelpers.en.yml +8 -0
- data/config/routes.rb +24 -0
- data/db/migrate/20140501113226_create_wobauth_roles.rb +9 -0
- data/db/migrate/20140501150743_create_wobauth_groups.rb +10 -0
- data/db/migrate/20140504124045_create_wobauth_memberships.rb +11 -0
- data/db/migrate/20140504143328_create_wobauth_authorities.rb +15 -0
- data/db/migrate/20140508120810_devise_create_wobauth_users.rb +55 -0
- data/db/migrate/20171231084355_additional_fields_to_wobauth_user.rb +8 -0
- data/lib/concerns/models/user.rb +44 -0
- data/lib/generators/templates/initializers/wobauth.rb +20 -0
- data/lib/generators/wobauth/install_generator.rb +20 -0
- data/lib/tasks/wobauth_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +26 -0
- data/lib/templates/erb/scaffold/edit.html.erb +1 -0
- data/lib/templates/erb/scaffold/index.html.erb +32 -0
- data/lib/templates/erb/scaffold/new.html.erb +1 -0
- data/lib/templates/erb/scaffold/show.html.erb +15 -0
- data/lib/templates/rails/scaffold_controller/controller.rb +66 -0
- data/lib/wobauth/engine.rb +33 -0
- data/lib/wobauth/version.rb +4 -0
- data/lib/wobauth.rb +57 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/db/test1.sqlite3 +0 -0
- data/test/dummy/log/test.log +1954 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-6/-6x3utBDawbjV5d477TJ9PeEoQTk9Yh292Yg_8Ox16U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-A/-A9u9WxFQ9YT2TSLvmYJYJf2Kg9JfDoIt6YZQRcwUHE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-C/-CJCPQLf_lB4gJr983MP5sZdH3uZuYPIe-xSw4QBln4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-K/-K6Cz6iJ4bgvnwN-rMFxBtyYEU6EGdLH9b4N38_GwIs.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-x/-xwsVQHMHEQFqvVNjKKkEiujw9_CUgnJ2Hmzampfy60.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/2J/2JNdqFTZ9i8DAT1rZCc-Xj70u9zcQtlJoqEK68sRPVM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/4N/4NSPDtUmuTVU5uLI-eBtnORjzrwVgeLgrgIJh4tjWeQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/4u/4uuqiFX5bLo0J5QqMPSZc642NRkdX4l-Vguvyq6Oe3U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5O/5Oqd8RObzOeHuHy3NTiGE5p_ZkpftjQQgJgS_3KKdH0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/6U/6UZEqCkIx3XO_NjOjjWyLET2-dS4Gs_RPAB9NtA99-A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/76/767sF803BgrHtDgUPUUn-HN41e6fklZIQkVKyKD59P4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/77/77ZyE9pECDHt-19ik7nBaJXJQT-7V2UDr49kFOIO1DM.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7n/7nJvPEaj-WV6RCKHc3hpHsAbWek8cidSKvDKLedQpH4.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/85/856_llbCcD4ntIG6h4uR2WQY9SrutzA-9K6xT53ZPTY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/9A/9A6WX6bvqMDoyDrYrGQy2l6nf_JtHoQZsa-pEJ0FgDU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BA/BABtX6k2NZISYrxZSviAXC8UIxZfRhEDDbx7dMf_ShQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/D4/D4_Vl_wB6Vq8O0LvQ9iHt-YqG_c0fUR4af06OZlk10k.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/DX/DXGc2xprS_TuG5PzNCaBHKBMWTlyrZZYA9jlvlcBn3M.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ex/ExDgDLUsesHZC1FAxhQLmTyBpg6IW4gVCUB8U8Ov-X4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/F8/F8M6mPdg93dPiXZzHGo3Y0I42et4yc5Hr-eCfuOUeac.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Hk/Hkx4xbJvgHfFgfNDKyHxertTGvARWOgVuNuGU-OWPEU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jo/Jom6Wnb-Sd-d3W24hNHS58BHtuw5Dsm7vvWVPtLB0PA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/K5/K5UnItDV1g9ixIoFloUxCNirxL5UFrOT0jz1vKy5shc.cache +31 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/K6/K6geC8zADOljHu2R2-DHUgVrgGyij9e4dnxgIdEypMU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/KW/KWpcGMHEfc0mpysCx46leXLgyrzubUIXWouB91Ia5Ik.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LD/LD1fywEt5YfgacZhvpug0VXFakWRb1jidort_y8Fl00.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LT/LTqeGcgCnDytohL1bGvcUZdnrp6gImr9Gzgfj6sYtW4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LX/LXirLCvjN2zWwKoda0ZdfOoFufIGRC9bZFKo95Kxs2w.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/MH/MH3Sbn3D_A-k2L9Qd_MSjC2d6zv52DnzX3REO1P8n-E.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmUDbY8fbYAMYUH3HOmHzTLkeJaf-49yXUpF5TXGnYM.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/O1/O1xVVUGePb-AZZi4nfbefQqZJEuQKvVAnHbbksdys0g.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Og/Og28UaPh4fHs8CazZFMRRClJKMdtcZ6TLkcrwXO9888.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Py/Py0iDud1Fnb6eLZHFV1BlJ1PKkeJS5bSVb8DL5Lyoyo.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qs/QscUYhnZ_Tw9H1UICqO4jqvLwSznyhEMlkTJRFR63Qk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rx/RxBkonRxRoJzfP-2eiuZPIg4Wy1eaNd6MQ6N0QTzLbw.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/S_/S_VAM9XIEPYa1eIrH2MGCvwgC6UuKNU3IsOsXYCbRfE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TK/TK13HHucosr5_ne6uScM6nK6naCAYu11S4GxXyvGEA4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TP/TPYDffricRYUN-8EoF99EbRAm5m9QVJ4NsV4JQHUaTU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TQ/TQZclZQajgRAt0UPyDLa5SDHOXXd7nrs_Aw1guZ1EDE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/U-/U-j-KeDrdeyrmflpuJSSH3aH_tGth_0zwnjl9eaecCU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ui/Ui_ImrdWE848w92udaqCheUJypT-7QIicGTDDcF94ZY.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vy/VyeoEaFiHk-BFfUz0QQyO1ywWUjhhvXaWjOhrueWuz4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/WC/WCZBAZL9AYx33c-WzmPLL8ZaSkyPBwQEpJSzDMruSTA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/XG/XG-1Cxql9XcU0QzVsKfaImD2F-_fbQakmCOO1PZeiO8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y-/Y-mfMOkq6o7o6NIVKY5m1HzoQPj6deRrSVoSnePwWDg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Z5/Z56duv_o-wQlnyich8DqrY8VfI5mRampXLuyzcCQSes.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_X/_XFCt_G6l_CeYOky6Ky04YbAJMGmZ1S55wnsXuzjbFQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_c/_cAbQgu5_t6QaopeTV6bHpVH6nABdZSHUD3dtw3TFvI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/aU/aUB5QePK5Y_57d0ISu6VcHykCHzl47ej-nXJSzHo7mM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ao/ao7sMvRzih2MlCNwwQnYbm-FUNM2rl1wlruiVgH8VbE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/b8/b8sc4SHWqZyiR9LoszM7AwU7Z9RStRdUzs5Cm4b1xi4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/dG/dGu-1JGz62Geuns1TpCaYbAwvwLKjSjDp_VhKV3nWOw.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/dH/dHU4yPNGwU72V1rymqid8RLS4ole8B-9UGSJG-QyDsQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ei/eiJS8jxPa_CT4ECt01iVkhPzc9QQShE__hFgFUVMqhc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hq/hqAVf5Mc94swL5QKxbwrtNQ1F6-4shrOpiZMk60yjMM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hz/hzzNh1KGk98zydo_p20ZW15iDYFoCsUZuYdK99A54Mo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ip/ip5FbXNQpdaOzVbU6_r90bYcY8R47qbE2_C79IUdlvQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/je/je9xQVOnasRNd1k49Q5KJdmxQscPKO-8qeVDMmmsVrI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/jt/jtOzRwEskymBEhztMwmAwvXzROImYepCy7Zb25fxexQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/m3/m3BDc8KCgIUXE0VeZ142byDvlbYuOEBpNW_2ucKyb3M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mf/mfkdFcsUrRviUKGZkElnxw6dCyhyArAFbAVNuqQKcsE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mx/mxQkXyjT__7etUOHa4WpbGL4YguqInaF8rQXNK4c6JU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/o4/o4yHfopv-ZxcXaMdi1_2O0CkBEWWQEd0wR0tEwKJ8s8.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/oF/oFjp7US8e9Cu4GOLqlO_vPIaX9jYwqrYbCFq6mgaYWE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/op/opKuUcXieH4Q4hch708zXOG2Rud2bhIilb38wKiOdjA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/p4/p4U2tbFHGXaOchAVtbEfIHRvWKO2i-0nsq_4vtGNABU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/s4/s4jckxw_fz9fwDYqkrZPCsD7cCATrXbD5R7ducBhtoU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/uP/uPXk7u0shmDjGGOhtU06VSo7E81DYc2t9OGhQUvxEA0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/vS/vSQW3iohJ14LLnwWgoHFeHB-I3yIzLi9tLoZkUaE81M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/vu/vuRt78a_J3dg7DUMHX1Nx9DYLME15Z1NjQ-4V8BoNCU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/w6/w6Gz48zxIouRBGOu5VmTHWsL9r0M4LKp124UOJ3mZN0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wj/wjsRbpDa20LzSzj66UKcgy3Wif53rLBEoeuyKIKz4pk.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wo/wo1g4ZKtmQmol-3MoVPFApwd5fnGEA23tCRCLuEw3D0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xG/xGQ1RojQn3N9C51pkj4Flt274TjVuszRi1Puir0p6dE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xN/xNqJDUb7i6VSD0HU-EV3dcNYRoz2d48cGwn1CBqLvVU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/y1/y1pwuOg2qdJFc_DgDEw6OIyr6GbmGpwV-p7X2sS64sU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zO/zOWzdA_n0s0vjbJ6IGB8gj1-mbqzbCywIQCMLr71qDE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zV/zVdKofyDUgEZzwP0GQ8q4RxOoxo-qoGazLMre0zxw9c.cache +0 -0
- data/test/tmp/config/initializers/wobauth.rb +15 -0
- data/test/tmp/config/locales/wobauth.de.yml +42 -0
- data/test/tmp/config/locales/wobauth.en.yml +27 -0
- metadata +636 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'devise'
|
2
|
+
module Wobauth
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
isolate_namespace Wobauth
|
5
|
+
|
6
|
+
config.generators do |g|
|
7
|
+
g.templates.unshift File::expand_path('../../templates', __FILE__)
|
8
|
+
g.test_framework :rspec, fixture: false
|
9
|
+
g.fixture_replacement :factory_bot, :dir => 'spec/factories'
|
10
|
+
end
|
11
|
+
|
12
|
+
config.eager_load_paths += Dir["#{config.root}/lib/concerns"]
|
13
|
+
|
14
|
+
initializer "wobauth.assets.precompile" do |app|
|
15
|
+
app.config.assets.precompile += %w(wobauth/authorities.js)
|
16
|
+
end
|
17
|
+
|
18
|
+
initializer 'wobauth.action_controller' do |app|
|
19
|
+
ActiveSupport.on_load(:action_controller) do
|
20
|
+
::ActionController::Base.helper Wobauth::ApplicationHelper
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
config.to_prepare do
|
25
|
+
Wobauth::ApplicationController.helper Rails.application.helpers
|
26
|
+
end
|
27
|
+
|
28
|
+
initializer "wobauth.factories", :after => "factory_bot.set_factory_paths" do
|
29
|
+
FactoryBot.definition_file_paths << File.expand_path('../../../spec/factories', __FILE__) if defined?(FactoryBot)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
data/lib/wobauth.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require "wobauth/engine"
|
2
|
+
|
3
|
+
module Wobauth
|
4
|
+
|
5
|
+
def self.setup
|
6
|
+
yield self
|
7
|
+
end
|
8
|
+
|
9
|
+
# authorizable types
|
10
|
+
#
|
11
|
+
mattr_reader :authorizable_types, :authorizable_group_method
|
12
|
+
@@authorizable_types = [ "Wobauth::User", "Wobauth::Group" ]
|
13
|
+
@@authorizable_group_method = :all
|
14
|
+
|
15
|
+
# authorized_for types
|
16
|
+
# Objects on which Wobauth should set authorization
|
17
|
+
#
|
18
|
+
mattr_accessor :authorized_for_types, :authorized_for_group_method
|
19
|
+
@@authorized_for_types = [ ]
|
20
|
+
@@authorized_for_group_method = :all
|
21
|
+
|
22
|
+
# is remote authentication possible using REMOTE_USER?
|
23
|
+
# default: check devise settings
|
24
|
+
mattr_writer :remote_authentication
|
25
|
+
@@remote_authentication = nil
|
26
|
+
|
27
|
+
def self.remote_authentication?
|
28
|
+
if @@remote_authentication.nil?
|
29
|
+
@@remote_authentication = User.devise_modules.include?(:remote_user_authenticatable)
|
30
|
+
end
|
31
|
+
@@remote_authentication
|
32
|
+
end
|
33
|
+
|
34
|
+
# config file for ldap settings
|
35
|
+
#
|
36
|
+
mattr_writer :ldap_config
|
37
|
+
@@ldap_config = nil
|
38
|
+
|
39
|
+
|
40
|
+
def self.ldap_options
|
41
|
+
return {} if @@ldap_config.blank?
|
42
|
+
if File.readable? @@ldap_config
|
43
|
+
config = YAML.load_file(@@ldap_config)
|
44
|
+
end
|
45
|
+
config ||= Hash.new
|
46
|
+
|
47
|
+
if config['ldap_options'].present?
|
48
|
+
opts = config['ldap_options'].symbolize_keys
|
49
|
+
opts.each do |k,v|
|
50
|
+
opts[k] = opts[k].symbolize_keys if opts[k].kind_of? Hash
|
51
|
+
end
|
52
|
+
else
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
Binary file
|
Binary file
|