decidim-decidim_awesome 0.12.3 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/README.md +1 -1
- data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +39 -5
- data/app/commands/decidim/decidim_awesome/admin/create_authorization_group.rb +42 -0
- data/app/commands/decidim/decidim_awesome/admin/create_custom_redirect.rb +10 -14
- data/app/commands/decidim/decidim_awesome/admin/create_menu_hack.rb +9 -8
- data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +3 -8
- data/app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb +4 -8
- data/app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb +3 -7
- data/app/commands/decidim/decidim_awesome/admin/destroy_authorization_group.rb +37 -0
- data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +10 -9
- data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +8 -7
- data/app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb +7 -13
- data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_admin.rb +7 -10
- data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +6 -11
- data/app/commands/decidim/decidim_awesome/admin/update_config.rb +12 -1
- data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +11 -11
- data/app/commands/decidim/decidim_awesome/admin/update_menu_hack.rb +10 -8
- data/app/controllers/concerns/decidim/decidim_awesome/enforce_access_authorizations.rb +49 -0
- data/app/controllers/concerns/decidim/decidim_awesome/needs_hashcash.rb +7 -5
- data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +2 -0
- data/app/controllers/decidim/decidim_awesome/admin/force_authorizations_controller.rb +44 -0
- data/app/controllers/decidim/decidim_awesome/required_authorizations_controller.rb +51 -13
- data/app/forms/concerns/decidim/decidim_awesome/proposals/admin/proposal_form_customizations.rb +59 -0
- data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_customizations.rb +28 -28
- data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_customizations_base.rb +36 -0
- data/app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb +66 -0
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +12 -26
- data/app/forms/decidim/decidim_awesome/admin/constraint_form.rb +2 -0
- data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +2 -1
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +20 -17
- data/app/overrides/decidim/assemblies/admin/assemblies/_form/add_visibility_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/conferences/admin/conferences/_form/add_visibility_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/participatory_processes/admin/participatory_process_groups/_form/add_visibility_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/participatory_processes/admin/participatory_processes/_form/add_visibility_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/shared/_login_modal/add_hashcash.html.erb.deface +3 -0
- data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +15 -0
- data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +0 -1
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +6 -1
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +5 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +1 -2
- data/app/queries/decidim/decidim_awesome/space_constraint_finder.rb +43 -0
- data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_methods.rb +3 -2
- data/app/services/decidim/decidim_awesome/access_authorization_service.rb +79 -0
- data/app/types/concerns/decidim/decidim_awesome/add_proposal_type_custom_fields.rb +2 -1
- data/app/views/decidim/decidim_awesome/admin/config/_authorization_options_form.html.erb +19 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_verifications.html.erb +71 -9
- data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +5 -4
- data/app/views/decidim/decidim_awesome/admin/shared/_visibility_notice.html.erb +8 -0
- data/app/views/decidim/decidim_awesome/hashcash/_hidden_field.html.erb +0 -1
- data/app/views/decidim/decidim_awesome/required_authorizations/index.html.erb +14 -4
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/ca.yml +31 -7
- data/config/locales/cs.yml +32 -7
- data/config/locales/de.yml +31 -7
- data/config/locales/en.yml +36 -12
- data/config/locales/es.yml +32 -7
- data/config/locales/eu.yml +3 -8
- data/config/locales/fr.yml +3 -8
- data/config/locales/ja.yml +70 -7
- data/config/locales/sv.yml +49 -0
- data/lib/decidim/decidim_awesome/admin_engine.rb +1 -0
- data/lib/decidim/decidim_awesome/{authorizator.rb → authorizer.rb} +1 -1
- data/lib/decidim/decidim_awesome/awesome.rb +5 -17
- data/lib/decidim/decidim_awesome/awesome_helpers.rb +14 -5
- data/lib/decidim/decidim_awesome/checksums.yml +11 -0
- data/lib/decidim/decidim_awesome/config.rb +18 -7
- data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +1 -1
- data/lib/decidim/decidim_awesome/engine.rb +3 -1
- data/lib/decidim/decidim_awesome/menu.rb +1 -1
- data/lib/decidim/decidim_awesome/middleware/current_config.rb +5 -10
- data/lib/decidim/decidim_awesome/test/initializer.rb +1 -1
- data/lib/decidim/decidim_awesome/test/shared_examples/proposal_form_examples.rb +191 -0
- data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +7 -3
- data/lib/decidim/decidim_awesome/version.rb +1 -1
- data/package.json +4 -4
- metadata +20 -5
- data/app/controllers/concerns/decidim/decidim_awesome/check_login_authorizations.rb +0 -60
- data/app/packs/src/decidim/decidim_awesome/admin/verification_selects.js +0 -21
data/config/locales/ja.yml
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
ja:
|
2
|
+
active_hashcash:
|
3
|
+
submit_filter: フィルター
|
4
|
+
waiting_label: 検証を待っています…
|
2
5
|
activemodel:
|
3
6
|
attributes:
|
4
7
|
config:
|
@@ -6,10 +9,13 @@ ja:
|
|
6
9
|
allow_images_in_editors: HTMLエディターで画像を許可する
|
7
10
|
allow_images_in_proposals: 提案エディターでの画像を許可する
|
8
11
|
allow_videos_in_editors: HTMLエディターで動画を許可する
|
12
|
+
authorization_options_form: 認証オプション
|
9
13
|
auto_save_forms: ローカルストレージにフォームを自動保存する
|
10
|
-
|
11
|
-
|
12
|
-
|
14
|
+
force_authorizations: 認証グループ %{id}
|
15
|
+
hashcash_login: 既存ユーザーのハッシュキャッシュボット保護を有効にする (ログイン)
|
16
|
+
hashcash_login_bits: Hashcashアルゴリズムのビット数 (ログイン)
|
17
|
+
hashcash_signup: 新規ユーザーのハッシュキャッシュボット保護を有効にする (新規登録)
|
18
|
+
hashcash_signup_bits: Hashcashアルゴリズムのビット数 (新規登録)
|
13
19
|
intergram_auto_no_response: ユーザーが最初のメッセージを送信し、応答が受信されなかった後1分後に送信されたメッセージ
|
14
20
|
intergram_auto_response: ユーザーが最初のメッセージを送信した直後に送信されるメッセージ
|
15
21
|
intergram_chat_id: チャットID
|
@@ -35,6 +41,7 @@ ja:
|
|
35
41
|
validate_title_min_length: タイトルに必要な最小文字数
|
36
42
|
validate_title_start_with_caps: タイトルを大文字で始めることを強制する
|
37
43
|
constraint:
|
44
|
+
application_context: '対象:'
|
38
45
|
component_id: 以下のみに適用
|
39
46
|
component_manifest: このタイプのコンポーネントのみ有効
|
40
47
|
participatory_space_manifest: 以下のタイプの参加型スペースに適用
|
@@ -206,7 +213,10 @@ ja:
|
|
206
213
|
index:
|
207
214
|
admin_head_tags: 管理者向けアプリケーションヘッダーに含まれる Awesome tags
|
208
215
|
decidim-admin: Adminモジュールより
|
216
|
+
decidim-assemblies: 参加スペースモジュールから
|
217
|
+
decidim-conferences: カンファレンスモジュールから
|
209
218
|
decidim-core: Coreモジュールより
|
219
|
+
decidim-participatory_processes: 参加型プロセスモジュールから
|
210
220
|
decidim-proposals: 提案モジュールより
|
211
221
|
decidim_version: Decidim version %{version}
|
212
222
|
errors:
|
@@ -221,6 +231,7 @@ ja:
|
|
221
231
|
処理を開始すると、バックグラウンドで実行されます。
|
222
232
|
start_image_migrations: "\U0001F449 今すぐ移行プロセスを開始する"
|
223
233
|
config:
|
234
|
+
anonymous: 非ログインユーザー
|
224
235
|
caution: '注意: この機能は、予期しない結果につながる可能性があるデフォルトの動作を大きく変更します。注意して使用してください!'
|
225
236
|
constraints:
|
226
237
|
add_condition: 条件を追加
|
@@ -229,6 +240,9 @@ ja:
|
|
229
240
|
delete: 削除
|
230
241
|
edit: 編集
|
231
242
|
title: '一部のケースのみ適用する:'
|
243
|
+
create_force_authorization:
|
244
|
+
error: 新しい認証グループの作成中にエラーが発生しました %{error}
|
245
|
+
success: 認証グループ %{key} を作成しました
|
232
246
|
create_proposal_custom_field:
|
233
247
|
error: 新しい「カスタム項目」ボックスの作成中にエラーが発生しました! %{error}
|
234
248
|
success: '「カスタム項目」ボックス %{key} が正常に作成されました'
|
@@ -238,6 +252,9 @@ ja:
|
|
238
252
|
create_scoped_style:
|
239
253
|
error: '新規CSS box作成エラー: %{error}'
|
240
254
|
success: CSS box %{key} が正常に作成されました
|
255
|
+
destroy_force_authorization:
|
256
|
+
error: 認証グループの削除中にエラーが発生しました %{error}
|
257
|
+
success: 認証グループ %{key} を削除しました
|
241
258
|
destroy_proposal_custom_field:
|
242
259
|
error: '「カスタム項目」ボックスの削除中にエラーが発生しました! %{error}'
|
243
260
|
success: '「カスタム項目」ボックス %{key} が正常に削除されました'
|
@@ -247,6 +264,7 @@ ja:
|
|
247
264
|
destroy_scoped_style:
|
248
265
|
error: 'CSS box削除エラー: %{error}'
|
249
266
|
success: CSS ボックス %{key} は正常に削除されました
|
267
|
+
force_authorizations: 認証グループ
|
250
268
|
form:
|
251
269
|
additional_proposal_sortings:
|
252
270
|
enable_all: すべての追加ソートオプションを有効にする
|
@@ -256,14 +274,23 @@ ja:
|
|
256
274
|
errors:
|
257
275
|
incorrect_css: 'Box #%{key} のCSSに問題があります'
|
258
276
|
incorrect_json: 'ボックス #%{key} 内の JSON 定義は無効です'
|
277
|
+
force_authorization_help_text: 認証ページのヘルプテキスト
|
259
278
|
help:
|
260
279
|
allow_images_in_editors: すべてのWYSIWYGエディタに画像アップローダーアイコンを追加します
|
261
280
|
allow_images_in_proposals: 提案エディターでの画像アップロードをすべてのユーザーができるようにします。
|
262
281
|
allow_videos_in_editors: すべてのWYSIWYGエディタに動画リンクアイコンを追加します
|
263
282
|
auto_save_forms: 調査などのフォームにユーザーが入力したデータを、LocalStorageを使って自動的に保存します。フォームを送信されていない場合、同じブラウザーで次回アクセスした時に復元されます。フォームを送信すると、データは削除されます。ユーザーがLocalStrorageのデータを削除した場合にも、データは復元されなくなります。
|
264
283
|
drag_and_drop_supported: 画像アップロード時にドラッグ&ドロップが利用できます。画像はサーバーにアップロードされ、外部リソースとして挿入されます(base64インラインエンコーディングは使用しません).
|
265
|
-
force_authorization_after_login: '有効にした場合、指定された認証が行われていなければ、ユーザーはログインまたは登録後に認証ページにリダイレクトされます。これはユーザーがログインする前に、特定の認証を使用してユーザーを強制的に本人確認させる場合(スパムを防ぐためなど) に便利です。'
|
266
284
|
force_authorization_help_text: 認証が必要な理由を説明するカスタムテキストを追加します。また、ユーザーがヘルプが必要な場合に備えて連絡方法を追加してください。
|
285
|
+
hashcash_i18n_key: 'ユーザーに表示されるログイン/登録ボタンのテキストは、i18n キー: %{key} でカスタマイズできます'
|
286
|
+
hashcash_login: |
|
287
|
+
人間を煩わせることなく、Railsアプリケーションをボットや総当たり攻撃から守ります。
|
288
|
+
Hashcashはプルーフ・オブ・ワーク方式の仕組みで、ユーザーがサインアップする前に計算上のパズルを解かせるものです(これはブラウザが自動的に実行します)。
|
289
|
+
hashcash_login_bits: このパラメータは、ハッシュキャッシュアルゴリズムが作業証明書の生成に使用するビット数を定義します。 16 (簡単) から 30 (極めて困難) ビットの間の値を使用することをお勧めします。 ログインフォームのデフォルト値は %{bits} ビットです。
|
290
|
+
hashcash_signup: |
|
291
|
+
人間を煩わせることなく、Railsアプリケーションをボットや総当たり攻撃から守ります。
|
292
|
+
Hashcashはプルーフ・オブ・ワーク方式の仕組みで、ユーザーがサインアップする前に計算上のパズルを解かせるものです(これはブラウザが自動的に実行します)。
|
293
|
+
hashcash_signup_bits: このパラメータは、ハッシュキャッシュアルゴリズムが作業証明書の生成に使用するビット数を定義します。 16 (簡単) から 30 (極めて困難) ビットの間の値を使用することをお勧めします。 登録フォームのデフォルト値は %{bits} ビットです。
|
267
294
|
intergram_about: IntergramはTelegramメッセンジャーを使用してページの下部に埋め込まれたライブサポートチャットウィジェットを処理します。
|
268
295
|
intergram_config: '<a href="https://web.telegram.org/#/im?p=@IntergramBot">@Intergram bot</a> をグループに招待するか、直接チャットを開始します。 <a href="https://github.com/idoco/intergram#embed-intergram-in-your-website-with-these-2-simple-steps">+ info</a>'
|
269
296
|
original_editor_override: バージョン 0.26 以降、エディタに画像をアップロードすることが可能になりました(管理者専用)。 そのため、ここでの画像設定はパブリックエディタにのみ影響を与えます(管理者は常に利用可能です)。
|
@@ -290,12 +317,20 @@ ja:
|
|
290
317
|
validate_title_max_marks_together: '並べて入力できる「?」と「!」の数を制限します。 すなわち、それが2の場合、「!!!」はテキストに記入できません'
|
291
318
|
validate_title_min_length: タイトルは常に必須です。この数字はゼロにはできません
|
292
319
|
verifications_html: |
|
293
|
-
|
294
|
-
|
295
|
-
また、これらの設定は全ユーザーに適用されますが、管理者は常に管理者バックエンドにアクセス可能です。
|
320
|
+
ここでは、参加スペースやコンポーネントに追加のアクセス制限を設けることができ、特定の場所へアクセスする前にユーザーの認証を必須とすることができます(スパム防止など)。
|
321
|
+
制限はすべてのユーザーに適用されますが、管理者は常に /admin パネルにアクセスできます。
|
296
322
|
validators:
|
297
323
|
body: '「body」フィールドのユーザー入力検証'
|
298
324
|
title: '「タイトル」フィールドのユーザー入力検証'
|
325
|
+
form_force_authorizations:
|
326
|
+
delete: 削除
|
327
|
+
force_authorizations_html: |
|
328
|
+
認証グループを定義します。各グループでは、ユーザーがプラットフォーム内の特定のエリアにアクセスするために、1つ以上の方法で認証を受けることを必須とできます。
|
329
|
+
help: 認証方式のグループを定義し、それに基づいてアクセスを制限することができます。
|
330
|
+
new: 新しい認証グループを追加
|
331
|
+
remove: この「認証グループ」を削除
|
332
|
+
sure_to_remove: この認証グループを削除してもよろしいですか?
|
333
|
+
title: 'アクセス制限:'
|
299
334
|
form_proposal_custom_fields:
|
300
335
|
delete: 削除
|
301
336
|
new: 新しい「カスタム項目」ボックスを追加
|
@@ -342,6 +377,7 @@ ja:
|
|
342
377
|
update:
|
343
378
|
error: 設定更新エラー %{error}
|
344
379
|
success: 設定は正常に更新されました
|
380
|
+
user_logged_in: ログインしているユーザー
|
345
381
|
constraints:
|
346
382
|
create:
|
347
383
|
error: 条件設定作成エラー
|
@@ -399,6 +435,25 @@ ja:
|
|
399
435
|
update:
|
400
436
|
error: 'リダイレクトの更新中にエラーが発生しました: %{error}'
|
401
437
|
success: リダイレクトを更新しました
|
438
|
+
hashcash:
|
439
|
+
filters:
|
440
|
+
ip_addresses: IP アドレスを表示
|
441
|
+
stamps: ハッシュキャッシュスタンプを表示
|
442
|
+
index:
|
443
|
+
bits: ビット数
|
444
|
+
created_at: 作成日時
|
445
|
+
help_html: |
|
446
|
+
このページには、システムで検出されたハッシュキャッシュスタンプが表示されます。 Hashcashは、ユーザーがサインアップする前に計算パズル(ブラウザによって自動的に実行される)を解決する必要がある作業証明システムです。
|
447
|
+
<br><br>
|
448
|
+
このリストの各エントリは、新規登録またはログインするたびにユーザーによって生成されたハッシュキャッシュスタンプを表します。
|
449
|
+
ip_address: IPアドレス
|
450
|
+
no_data: ハッシュキャッシュスタンプが見つかりません
|
451
|
+
request_path: リクエストパス
|
452
|
+
ip_addresses:
|
453
|
+
help_html: このページには、システムで検出されたすべてのIPアドレスが、生成したHashcashスタンプの数順に一覧表示されます。 <br><br>各スタンプは、ユーザーによるログインまたはサインアップのいずれかの操作を表します。この情報を利用して、不審な活動を検出することができます。
|
454
|
+
ip_address: IPアドレス
|
455
|
+
no_data: IPアドレスが見つかりません
|
456
|
+
stamps: Hashcashスタンプ
|
402
457
|
menu:
|
403
458
|
admins: スコープ付き管理者
|
404
459
|
custom_redirects: カスタムリダイレクト
|
@@ -406,6 +461,7 @@ ja:
|
|
406
461
|
livechat: ライブチャット
|
407
462
|
maintenance:
|
408
463
|
checks: システム互換性
|
464
|
+
hashcash: Hashcashスタンプ
|
409
465
|
maintenance: メンテナンス
|
410
466
|
private_data: プライベートデータ
|
411
467
|
menu_hacks: メニュー調整
|
@@ -442,6 +498,8 @@ ja:
|
|
442
498
|
title: グローバルメニューホームブロック
|
443
499
|
menu:
|
444
500
|
title: メインメニュー
|
501
|
+
mobile_menu:
|
502
|
+
title: モバイルメニュー
|
445
503
|
new: 新しい項目
|
446
504
|
remove: 追加の削除
|
447
505
|
remove_hack: カスタマイズの削除
|
@@ -502,6 +560,9 @@ ja:
|
|
502
560
|
scoped_styles:
|
503
561
|
menu:
|
504
562
|
title: 公開フロントエンド
|
563
|
+
visibility:
|
564
|
+
info_html: '%{awesome_link} による検証を使用して、追加のアクセス制限を管理できます。'
|
565
|
+
restricted_html: このスペースは %{awesome_link} による追加のアクセス制限を使用しています。
|
505
566
|
admin_log:
|
506
567
|
component:
|
507
568
|
destroy_private_data: "%{user_name} は %{space_name} 内のプライベートデータの項目 %{resource_name} を%{count} 件破棄しました"
|
@@ -573,6 +634,7 @@ ja:
|
|
573
634
|
proposal_private_custom_fields_disclosure: この情報は公開されません
|
574
635
|
required_authorizations:
|
575
636
|
index:
|
637
|
+
authorization_options_invalid: 残念ながら、この権限を持っていますが、あなたを検証するために使用されたデータは、このコンテキストでは無効です。
|
576
638
|
cancel: あとで %{link} を行う
|
577
639
|
granted_title: 許可された本人確認
|
578
640
|
logout: ログアウトする
|
@@ -639,6 +701,7 @@ ja:
|
|
639
701
|
title: 'メンテナンスツール: %{title}'
|
640
702
|
titles:
|
641
703
|
checks: システム互換性チェック
|
704
|
+
hashcash: Hashcashスタンプ
|
642
705
|
private_data: プライベートデータのクリーンアップ
|
643
706
|
awesome_config:
|
644
707
|
amendments: 修正
|
data/config/locales/sv.yml
CHANGED
@@ -1,17 +1,43 @@
|
|
1
1
|
sv:
|
2
|
+
active_hashcash:
|
3
|
+
submit_filter: Filtrera
|
4
|
+
waiting_label: Väntar på verifiering ...
|
2
5
|
activemodel:
|
3
6
|
attributes:
|
4
7
|
config:
|
8
|
+
additional_proposal_sortings: Ytterligare sorteringsalternativ aktiva
|
9
|
+
allow_images_in_editors: Tillåt bilder i HTML-redigeraren
|
5
10
|
allow_images_in_proposals: Tillåt bilder i förslagsfältet
|
11
|
+
allow_videos_in_editors: Tillåt videor i HTML-redigeraren
|
6
12
|
auto_save_forms: Spara formulär automatiskt i lokal lagring
|
13
|
+
hashcash_login: Aktivera Hashcash bot-skydd för befintliga användare (inloggning)
|
14
|
+
hashcash_login_bits: Antal bitar för Hashcash-algoritmen (inloggning)
|
15
|
+
hashcash_signup: Aktivera Hashcash bot-skydd för nya användare (registrering)
|
16
|
+
hashcash_signup_bits: Antal bitar för Hashcash-algoritmen (registrering)
|
17
|
+
intergram_auto_no_response: Ett meddelande som skickas en minut efter att användaren skickar sitt första meddelande och inget svar tagits emot
|
18
|
+
intergram_auto_response: Ett meddelande som skickas omedelbart efter att användaren skickar sitt första meddelande
|
7
19
|
intergram_chat_id: Chatt ID
|
8
20
|
intergram_color: Huvudfärg för widget
|
21
|
+
intergram_for_admins: Aktivera Intergram-chatt i admin-backend
|
9
22
|
intergram_intro_message: Första meddelandet när användaren öppnar chatten för första gången
|
10
23
|
intergram_require_login: Endast för inloggade användare
|
24
|
+
intergram_title_closed: Rubrik för stängd chatt
|
25
|
+
intergram_title_open: Rubrik för öppen chatt
|
26
|
+
intergram_use_floating_button: Om markerad är den stängda chatten alltid en knapp istället för en text
|
11
27
|
proposal_custom_fields: Tilläggsfält %{id}
|
12
28
|
scoped_styles: Tilläggsstilar %{id}
|
29
|
+
user_timezone: Tillåt användare att ställa in tidszon i sin profil
|
30
|
+
validate_body_max_caps_percent: Maximal tillåten procentandel versaler för brödtexten
|
31
|
+
validate_body_max_marks_together: Maximalt antal symboler i rad tillåtna i brödtexten
|
32
|
+
validate_body_min_length: Minst tillåtna antal tecken för brödtexten
|
33
|
+
validate_body_start_with_caps: Tvinga brödtexten att börja med en stor bokstav
|
34
|
+
validate_title_max_caps_percent: Maximal tillåten procentandel versaler för titeln
|
35
|
+
validate_title_max_marks_together: Maximalt antal symboler i rad tillåtna i titeln
|
36
|
+
validate_title_min_length: Minst tillåtna antal tecken för titeln
|
37
|
+
validate_title_start_with_caps: Tvinga titeln att börja med en versal
|
13
38
|
constraint:
|
14
39
|
component_id: eller specifikt i
|
40
|
+
component_manifest: Endast i komponenter av typ
|
15
41
|
participatory_space_slug: Endast i
|
16
42
|
custom_redirect:
|
17
43
|
active: Aktiv
|
@@ -24,8 +50,27 @@ sv:
|
|
24
50
|
target: Öppna i
|
25
51
|
url: Webbadress
|
26
52
|
visibility: Synlighet
|
53
|
+
organization:
|
54
|
+
awesome_admins_available_authorizations: Tillåt administratörer att manuellt verifiera användare med dessa auktoriseringar
|
55
|
+
user:
|
56
|
+
user_time_zone: Personlig tidszon
|
27
57
|
decidim:
|
28
58
|
admin:
|
59
|
+
actions:
|
60
|
+
manage: Hantera
|
61
|
+
filters:
|
62
|
+
admin_accountability:
|
63
|
+
admin_role_type:
|
64
|
+
label: Rolltyp
|
65
|
+
role:
|
66
|
+
label: Roll
|
67
|
+
role_type_eq:
|
68
|
+
label: Rolltyp
|
69
|
+
label:
|
70
|
+
search_field_end_date: 'Till datum:'
|
71
|
+
search_field_start_date: 'Från datum:'
|
72
|
+
search_placeholder:
|
73
|
+
user_name_or_user_email_cont: Sök på användarnamn, e-post
|
29
74
|
menu:
|
30
75
|
decidim_awesome: Decidim Awesome
|
31
76
|
components:
|
@@ -35,6 +80,7 @@ sv:
|
|
35
80
|
global:
|
36
81
|
announcement: Meddelande
|
37
82
|
iframe: Iframe kod
|
83
|
+
iframe_help: 'Ange din kod som html: <iframe width="100%" height="700" frameBorder="0" allowFullscreen src="..."></iframe>. Innehållet kommer att saneras från andra HTML-taggar. Se till att använda 100% som bredd för att fylla skärmen.'
|
38
84
|
step:
|
39
85
|
announcement: Meddelande
|
40
86
|
iframe: Iframe kod
|
@@ -43,7 +89,10 @@ sv:
|
|
43
89
|
settings:
|
44
90
|
global:
|
45
91
|
announcement: Meddelande
|
92
|
+
collapse: Börja med kollapsad meny
|
93
|
+
map_center: Kartans centrum (Latitud, Longitud)
|
46
94
|
map_height: Karthöjd (px)
|
95
|
+
map_zoom: Zoom (valfritt tal mellan 0 och 18)
|
47
96
|
menu_amendments: Visa ändringsförslag
|
48
97
|
menu_meetings: Visa möten
|
49
98
|
step:
|
@@ -24,6 +24,7 @@ module Decidim
|
|
24
24
|
resources :scoped_styles, param: :var, only: [:create, :destroy]
|
25
25
|
resources :proposal_custom_fields, param: :var, only: [:create, :destroy]
|
26
26
|
resources :scoped_admins, param: :var, only: [:create, :destroy]
|
27
|
+
resources :force_authorizations, param: :var, only: [:create, :destroy]
|
27
28
|
get :admin_accountability, to: "admin_accountability#index", as: "admin_accountability"
|
28
29
|
post :export_admin_accountability, to: "admin_accountability#export", as: "export_admin_accountability"
|
29
30
|
get :users, to: "config#users"
|
@@ -15,7 +15,7 @@ module Decidim
|
|
15
15
|
autoload :Lock, "decidim/decidim_awesome/lock"
|
16
16
|
autoload :TranslatedCustomFieldsType, "decidim/decidim_awesome/api/types/translated_custom_fields_type"
|
17
17
|
autoload :LocalizedCustomFieldsType, "decidim/decidim_awesome/api/types/localized_custom_fields_type"
|
18
|
-
autoload :
|
18
|
+
autoload :Authorizer, "decidim/decidim_awesome/authorizer"
|
19
19
|
|
20
20
|
# Awesome comes with some components for participatory spaces
|
21
21
|
# Currently :awesome_map and :awesome_iframe, list them here
|
@@ -203,22 +203,10 @@ module Decidim
|
|
203
203
|
false
|
204
204
|
end
|
205
205
|
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
|
210
|
-
config_accessor :force_authorization_after_login do
|
211
|
-
[]
|
212
|
-
end
|
213
|
-
|
214
|
-
# By default all methods specified in force_authorization_after_login must be granted in order to access the platform
|
215
|
-
# if set to true, the user will be able to access the platform if any of the methods is granted
|
216
|
-
config_accessor :force_authorization_with_any_method do
|
217
|
-
false
|
218
|
-
end
|
219
|
-
|
220
|
-
# When force_authorization_after_login is enabled, this text will be shown to the user as a help text (ie: add a contact information)
|
221
|
-
config_accessor :force_authorization_help_text do
|
206
|
+
# Allows to enforce specific authorizations to access the platform
|
207
|
+
# Constraints can be defined for each group
|
208
|
+
# Set to :disabled to completely remove this feature
|
209
|
+
config_accessor :force_authorizations do
|
222
210
|
{}
|
223
211
|
end
|
224
212
|
|
@@ -10,11 +10,13 @@ module Decidim
|
|
10
10
|
|
11
11
|
# Returns the normalized config for an Organization and the current url
|
12
12
|
def awesome_config_instance
|
13
|
-
memoize("current_config") do
|
13
|
+
@awesome_config_instance ||= memoize("current_config") do
|
14
14
|
config = Config.new(request.env["decidim.current_organization"])
|
15
|
-
config.context_from_request(request)
|
15
|
+
config.context_from_request!(request)
|
16
16
|
config
|
17
17
|
end
|
18
|
+
@awesome_config_instance.application_context!(current_user:) if respond_to?(:current_user)
|
19
|
+
@awesome_config_instance
|
18
20
|
end
|
19
21
|
|
20
22
|
def awesome_config
|
@@ -86,6 +88,13 @@ module Decidim
|
|
86
88
|
end
|
87
89
|
end
|
88
90
|
|
91
|
+
# Collects all the force authorizations that is applied in the current URL context
|
92
|
+
def awesome_force_authorizations
|
93
|
+
memoize("awesome_force_authorizations") do
|
94
|
+
awesome_config_instance.collect_sub_configs_values("force_authorization")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
89
98
|
# this will check if the current component has been configured to use a custom voting manifest
|
90
99
|
def awesome_voting_manifest_for(component)
|
91
100
|
memoize("awesome_voting_manifest_for_#{component.id}") do
|
@@ -93,11 +102,11 @@ module Decidim
|
|
93
102
|
end
|
94
103
|
end
|
95
104
|
|
96
|
-
#
|
97
|
-
# returns an instance of Decidim::DecidimAwesome::
|
105
|
+
# Retrieves all the "admins_available_authorizations" for the user along with other possible authorizations
|
106
|
+
# returns an instance of Decidim::DecidimAwesome::Authorizer
|
98
107
|
def awesome_authorizations_for(user)
|
99
108
|
memoize("awesome_authorizations_for_#{user.id}") do
|
100
|
-
|
109
|
+
Authorizer.new(user, awesome_config[:admins_available_authorizations])
|
101
110
|
end
|
102
111
|
end
|
103
112
|
|
@@ -1,6 +1,15 @@
|
|
1
1
|
decidim-admin:
|
2
2
|
/app/views/layouts/decidim/admin/_header.html.erb:
|
3
3
|
decidim-0.29.1: b2ae319d5bcf43954bbe0edb9a4e3ffb
|
4
|
+
decidim-assemblies:
|
5
|
+
/app/views/decidim/assemblies/admin/assemblies/_form.html.erb:
|
6
|
+
decidim-0.29.4: 020a06e40fd3b8dae4ec63b2afcac9cb
|
7
|
+
decidim-participatory_processes:
|
8
|
+
/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb:
|
9
|
+
decidim-0.29.4: 41d304c7583bdd51cbd5b6e98b27fded
|
10
|
+
decidim-conferences:
|
11
|
+
/app/views/decidim/conferences/admin/conferences/_form.html.erb:
|
12
|
+
decidim-0.29.4: 40c04d3e64936598f2c3acedf8e99372
|
4
13
|
decidim-core:
|
5
14
|
/app/packs/entrypoints/decidim_editor.js:
|
6
15
|
decidim-0.29.1: beddd77e3893fd0b7cd2679a7ee6e536
|
@@ -34,6 +43,8 @@ decidim-core:
|
|
34
43
|
decidim-0.29.1: b30423406afd43bb9af2c98d59d43632
|
35
44
|
/app/views/decidim/devise/sessions/new.html.erb:
|
36
45
|
decidim-0.29.1: a8fe60cd10c1636822c252d5488a979d
|
46
|
+
/app/views/decidim/shared/_login_modal.html.erb:
|
47
|
+
decidim-0.29.1: 0d615603bb45f7b209032578dda9fc72
|
37
48
|
decidim-proposals:
|
38
49
|
/lib/decidim/proposals/proposal_serializer.rb:
|
39
50
|
decidim-0.29.1: 58915ff3a7528463587d3762a93ff51b
|
@@ -11,12 +11,13 @@ module Decidim
|
|
11
11
|
participatory_space_manifest: nil,
|
12
12
|
participatory_space_slug: nil,
|
13
13
|
component_id: nil,
|
14
|
-
component_manifest: nil
|
14
|
+
component_manifest: nil,
|
15
|
+
application_context: "anonymous"
|
15
16
|
}
|
16
17
|
@sub_configs = {}
|
17
18
|
end
|
18
19
|
|
19
|
-
attr_reader :context, :organization, :vars
|
20
|
+
attr_reader :context, :organization, :vars, :application_context
|
20
21
|
attr_writer :defaults
|
21
22
|
|
22
23
|
def defaults
|
@@ -29,23 +30,33 @@ module Decidim
|
|
29
30
|
end
|
30
31
|
|
31
32
|
# convert context to manifest, slug and id
|
32
|
-
def context_from_request(request)
|
33
|
+
def context_from_request!(request)
|
33
34
|
@config = nil
|
34
35
|
@context = Decidim::DecidimAwesome::ContextAnalyzers::RequestAnalyzer.context_for request
|
35
36
|
end
|
36
37
|
|
37
38
|
# convert component to manifest, slug and id
|
38
|
-
def context_from_component(component)
|
39
|
+
def context_from_component!(component)
|
39
40
|
@config = nil
|
40
41
|
@context = Decidim::DecidimAwesome::ContextAnalyzers::ComponentAnalyzer.context_for component
|
41
42
|
end
|
42
43
|
|
43
44
|
# convert participatory space to manifest, slug and id
|
44
|
-
def context_from_participatory_space(space)
|
45
|
+
def context_from_participatory_space!(space)
|
45
46
|
@config = nil
|
46
47
|
@context = Decidim::DecidimAwesome::ContextAnalyzers::ParticipatorySpaceAnalyzer.context_for space
|
47
48
|
end
|
48
49
|
|
50
|
+
def application_context!(ctx = {})
|
51
|
+
@application_context = ctx
|
52
|
+
@context[:application_context] = case ctx[:current_user]
|
53
|
+
when Decidim::User
|
54
|
+
"user_logged_in"
|
55
|
+
else
|
56
|
+
"anonymous"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
49
60
|
# config processed in context
|
50
61
|
def config
|
51
62
|
@config ||= calculate_config
|
@@ -93,7 +104,7 @@ module Decidim
|
|
93
104
|
# if no constraints defined, applies to everything
|
94
105
|
return true if constraints.blank?
|
95
106
|
|
96
|
-
# if
|
107
|
+
# if contains the "none" constraints, deactivate everything else
|
97
108
|
return false if constraints.detect { |c| c.settings["participatory_space_manifest"] == "none" }
|
98
109
|
|
99
110
|
# check if current context matches some constraint
|
@@ -117,7 +128,7 @@ module Decidim
|
|
117
128
|
sub_configs_for(singular_key)[subkey.to_sym]&.add_constraints constraints
|
118
129
|
end
|
119
130
|
|
120
|
-
# Merges all
|
131
|
+
# Merges all sub-configs values for custom_styles or any other scoped configs
|
121
132
|
# by default filtered according to the current scope, a block can be passed for custom filtering
|
122
133
|
# ie, collect everything:
|
123
134
|
# collect_sub_configs_values("scoped_style") { true }
|
@@ -30,6 +30,7 @@ module Decidim
|
|
30
30
|
# Add hashcash to signup and login
|
31
31
|
Decidim::Devise::SessionsController.include(Decidim::DecidimAwesome::NeedsHashcash)
|
32
32
|
Decidim::Devise::RegistrationsController.include(Decidim::DecidimAwesome::NeedsHashcash)
|
33
|
+
Decidim::ApplicationController.include(Decidim::DecidimAwesome::NeedsHashcash)
|
33
34
|
end
|
34
35
|
# Include additional helpers globally
|
35
36
|
ActiveSupport.on_load(:action_view) { include Decidim::DecidimAwesome::AwesomeHelpers }
|
@@ -56,6 +57,7 @@ module Decidim
|
|
56
57
|
:validate_body_max_marks_together,
|
57
58
|
:validate_body_start_with_caps)
|
58
59
|
Decidim::Proposals::ProposalForm.include(Decidim::DecidimAwesome::Proposals::ProposalFormCustomizations)
|
60
|
+
Decidim::Proposals::Admin::ProposalForm.include(Decidim::DecidimAwesome::Proposals::Admin::ProposalFormCustomizations)
|
59
61
|
end
|
60
62
|
|
61
63
|
if DecidimAwesome.enabled?(:proposal_custom_fields, :proposal_private_custom_fields)
|
@@ -118,7 +120,7 @@ module Decidim
|
|
118
120
|
|
119
121
|
initializer "decidim_decidim_awesome.overrides", after: "decidim.action_controller" do
|
120
122
|
config.to_prepare do
|
121
|
-
Decidim::ApplicationController.include(Decidim::DecidimAwesome::
|
123
|
+
Decidim::ApplicationController.include(Decidim::DecidimAwesome::EnforceAccessAuthorizations) if DecidimAwesome.enabled?(:force_authorizations)
|
122
124
|
Decidim::ApplicationController.include(Decidim::DecidimAwesome::UseUserTimeZone) if Decidim::DecidimAwesome.enabled?(:user_timezone)
|
123
125
|
|
124
126
|
# Auto-insert some csp directives
|
@@ -192,7 +192,7 @@ module Decidim
|
|
192
192
|
menu_hacks_home_content_block_menu: config_enabled?(:home_content_block_menu),
|
193
193
|
custom_redirects: config_enabled?(:custom_redirects),
|
194
194
|
livechat: config_enabled?(:intergram_for_admins, :intergram_for_public),
|
195
|
-
verifications: config_enabled?(:
|
195
|
+
verifications: config_enabled?(:force_authorizations),
|
196
196
|
maintenance: true
|
197
197
|
}
|
198
198
|
end
|
@@ -17,15 +17,10 @@ module Decidim
|
|
17
17
|
def call(env)
|
18
18
|
@request = Rack::Request.new(env)
|
19
19
|
if @request.env["decidim.current_organization"] && processable_path?
|
20
|
-
|
21
|
-
env["decidim_awesome.current_config"] =
|
20
|
+
# memoize for later
|
21
|
+
@config = env["decidim_awesome.current_config"] = awesome_config_instance
|
22
22
|
tamper_user_model
|
23
23
|
add_flash_message_from_request(env)
|
24
|
-
|
25
|
-
# puts "requested path: #{env["PATH_INFO"]}"
|
26
|
-
# puts "current_organization: #{@request.env["decidim.current_organization"]&.id}"
|
27
|
-
# puts "potential_admins: #{Decidim::User.awesome_potential_admins}"
|
28
|
-
# puts "scoped admins: #{Decidim::User.awesome_admins_for_current_scope}"
|
29
24
|
else
|
30
25
|
reset_user_model
|
31
26
|
end
|
@@ -35,7 +30,7 @@ module Decidim
|
|
35
30
|
|
36
31
|
private
|
37
32
|
|
38
|
-
# a workaround to set a flash message if
|
33
|
+
# a workaround to set a flash message if coming from the error controller (route not found)
|
39
34
|
def add_flash_message_from_request(env)
|
40
35
|
return unless scoped_admins_active?
|
41
36
|
return unless @request.params.has_key? "unauthorized"
|
@@ -45,7 +40,7 @@ module Decidim
|
|
45
40
|
|
46
41
|
def awesome_config_instance
|
47
42
|
@awesome_config_instance = Config.new @request.env["decidim.current_organization"]
|
48
|
-
@awesome_config_instance.context_from_request @request
|
43
|
+
@awesome_config_instance.context_from_request! @request
|
49
44
|
@awesome_config_instance
|
50
45
|
end
|
51
46
|
|
@@ -127,7 +122,7 @@ module Decidim
|
|
127
122
|
# to access certain deeper routes it requires first to click on a parent route, even without Post permissions in there
|
128
123
|
# this adds this additional routes to these cases
|
129
124
|
# For instance:
|
130
|
-
# accessing /admin/participatory_processes/
|
125
|
+
# accessing /admin/participatory_processes/some-process requires access first to /admin/participatory_processes
|
131
126
|
def additional_get_constraints(constraints)
|
132
127
|
return [] unless @request.get?
|
133
128
|
|
@@ -8,7 +8,7 @@ Decidim::DecidimAwesome.configure do |config|
|
|
8
8
|
:allow_images_in_proposals,
|
9
9
|
:auto_save_forms,
|
10
10
|
:user_timezone,
|
11
|
-
:
|
11
|
+
:force_authorizations,
|
12
12
|
:admins_available_authorizations,
|
13
13
|
:intergram_for_admins,
|
14
14
|
:intergram_for_public,
|