File tree Expand file tree Collapse file tree
lib/decidim/diba_census_api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ # An AuthorizationHandler that uses the DibaCensusApiService to create ephemeral authorizations
4+ class EphemeralDibaCensusApiAuthorizationHandler < DibaCensusApiAuthorizationHandler
5+ def to_partial_path
6+ "diba_census_api_authorization/form"
7+ end
8+ end
Original file line number Diff line number Diff line change 2525 dni : ' DNI'
2626 nie : ' NIE'
2727 passport : ' Passaport'
28+ ephemeral_diba_census_api_authorization_handler :
29+ explanation : Autoritza la teva sessió contra el Padró Municipal
30+ document_types :
31+ dni : DNI
32+ nie : NIE
33+ passport : Passaport
34+ fields :
35+ age : Edat mínima
36+ birthdate : Data de naixement
37+ max_age : Edat màxima
38+ name : Padró municipal per a accés temporal
39+ type : API
2840 diba_census_api :
2941 admin :
3042 menu : ' Cens via API'
Original file line number Diff line number Diff line change 2525 dni : DNI
2626 nie : NIE
2727 passport : Passport
28+ ephemeral_diba_census_api_authorization_handler :
29+ explanation : Authorize your session against the Municipality Census
30+ document_types :
31+ dni : DNI
32+ nie : NIE
33+ passport : Passport
34+ fields :
35+ age : Minimum age
36+ birthdate : Birth date
37+ max_age : Maximum age
38+ name : Municipality Census for temporary access
39+ type : API
2840 diba_census_api :
2941 admin :
3042 menu : Census API config
Original file line number Diff line number Diff line change 2525 dni : DNI
2626 nie : NIE
2727 passport : Pasaporte
28+ ephemeral_diba_census_api_authorization_handler :
29+ explanation : Autoriza tu sesión contra el Padrón Municipal
30+ document_types :
31+ dni : DNI
32+ nie : NIE
33+ passport : Pasaporte
34+ fields :
35+ age : Edad mínima
36+ birthdate : Fecha de nacimiento
37+ max_age : Edad máxima
38+ name : Padrón Municipal para acceso temporal
39+ type : API
2840 diba_census_api :
2941 admin :
3042 menu : Configurar API censo
Original file line number Diff line number Diff line change @@ -11,16 +11,24 @@ class Engine < ::Rails::Engine
1111 isolate_namespace Decidim ::DibaCensusApi
1212
1313 initializer "decidim_diba_census_api.add_authorization_handlers" do |_app |
14- Decidim ::Verifications . register_workflow (
15- :diba_census_api_authorization_handler
16- ) do |auth |
14+ Decidim ::Verifications . register_workflow ( :diba_census_api_authorization_handler ) do |auth |
1715 auth . form = "DibaCensusApiAuthorizationHandler"
1816 auth . action_authorizer = "Decidim::AgeActionAuthorization::Authorizer"
1917 auth . options do |options |
2018 options . attribute :age , type : :string , required : false
2119 options . attribute :max_age , type : :string , required : false
2220 end
2321 end
22+
23+ Decidim ::Verifications . register_workflow ( :ephemeral_diba_census_api_authorization_handler ) do |auth |
24+ auth . ephemeral = true
25+ auth . form = "EphemeralDibaCensusApiAuthorizationHandler"
26+ auth . action_authorizer = "Decidim::AgeActionAuthorization::Authorizer"
27+ auth . options do |options |
28+ options . attribute :age , type : :string , required : false
29+ options . attribute :max_age , type : :string , required : false
30+ end
31+ end
2432 end
2533 end
2634 end
You can’t perform that action at this time.
0 commit comments