Skip to content

Commit

Permalink
Apply AgeAuthorizationHandler to all AuthorizationHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
xredo committed Dec 5, 2018
1 parent 57f3b8c commit ab84e9a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/locales/en.yml
Expand Up @@ -20,7 +20,7 @@ en:
type: Combined
fields:
birthdate: Date of birth
birthdate: Minimum age
age: Minimum age
features:
proposals:
actions:
Expand Down
1 change: 1 addition & 0 deletions decidim-census/config/locales/ca.yml
Expand Up @@ -18,6 +18,7 @@ ca:
type: Excel
fields:
birthdate: Data de naixement
age: 'Edat mínima'
census:
errors:
messages:
Expand Down
1 change: 1 addition & 0 deletions decidim-census/config/locales/en.yml
Expand Up @@ -18,6 +18,7 @@ en:
type: Excel
fields:
birthdate: Birthdate
age: 'Minimum age'
census:
errors:
messages:
Expand Down
1 change: 1 addition & 0 deletions decidim-census/config/locales/es.yml
Expand Up @@ -18,6 +18,7 @@ es:
type: Excel
fields:
birthdate: Fecha de nacimiento
age: 'Edad mínima'
census:
errors:
messages:
Expand Down
3 changes: 3 additions & 0 deletions decidim-census/lib/decidim/census/engine.rb
Expand Up @@ -17,6 +17,9 @@ class Engine < ::Rails::Engine
Decidim::Verifications.register_workflow(:census_authorization_handler) do |auth|
auth.form = 'CensusAuthorizationHandler'
auth.action_authorizer = 'Decidim::AgeActionAuthorization::Authorizer'
auth.options do |options|
options.attribute :age, type: :string, required: false
end
end
end

Expand Down
3 changes: 3 additions & 0 deletions decidim-diba_census_api/config/locales/ca.yml
Expand Up @@ -17,6 +17,9 @@ ca:
name: Padró Municipal
explanation: Autoritza el teu compte d'usuari contra el Padró Municipal
type: API
fields:
birthdate: Data de naixement
age: Edat mínima
document_types:
dni: 'DNI'
nie: 'NIE'
Expand Down
3 changes: 3 additions & 0 deletions decidim-diba_census_api/config/locales/en.yml
Expand Up @@ -17,6 +17,9 @@ en:
name: Municipality Census
explanation: Authorize your user account against the Municipality Census
type: API
fields:
birthdate: Birth date
age: Minimum age
document_types:
dni: DNI
nie: NIE
Expand Down
3 changes: 3 additions & 0 deletions decidim-diba_census_api/config/locales/es.yml
Expand Up @@ -17,6 +17,9 @@ es:
name: Padrón Municipal
explanation: Autoriza tu cuenta de usuario contra el Padrón Municipal
type: API
fields:
birthdate: Fecha de nacimiento
age: Edad mínima
document_types:
dni: DNI
nie: NIE
Expand Down
3 changes: 3 additions & 0 deletions decidim-diba_census_api/lib/decidim/diba_census_api/engine.rb
Expand Up @@ -17,6 +17,9 @@ class Engine < ::Rails::Engine
) do |auth|
auth.form = 'DibaCensusApiAuthorizationHandler'
auth.action_authorizer = 'Decidim::AgeActionAuthorization::Authorizer'
auth.options do |options|
options.attribute :age, type: :string, required: false
end
end
end

Expand Down

0 comments on commit ab84e9a

Please sign in to comment.