isaca-rails 0.4.7 → 0.4.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7afe3c204bc4c58d289096a6bd76b3361f1aeb73ff76f7c6c16d7867183dcd3e
|
4
|
+
data.tar.gz: b627a1002caab316552a2f8084e4fb9a17527c1567496ae5c6d4c388a5155f3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb8446322b9a69b9318683bcc8891eb46a69a7b194ffdd071b136c21cd788fd7982366668a3aa48c0cc1ab3ae25ad74b30c84d5705ffc6d4ce44dff87a6dd53c
|
7
|
+
data.tar.gz: 507b7488b1eaa633c0087e2950ae60cb9a8af0dba73e5bd1ceeeff874e286ef74013474f7d3fb4971f1160da1e99259a63a34dd3f3adb3fb4f14579a94288477
|
@@ -8,8 +8,17 @@ class Isaca::Rails::UsersConsentController < Isaca::Rails::ApplicationController
|
|
8
8
|
def create
|
9
9
|
@form_object = UserConsent::Agreement::FormObject.new(agreement_params)
|
10
10
|
|
11
|
-
if @form_object.
|
12
|
-
|
11
|
+
if @form_object.valid?
|
12
|
+
response = Isaca::Request::ReportConsent.get(current_isaca_user.imis_id, current_isaca_user.email, {
|
13
|
+
marketing: agreement_params[:marketing_policy]
|
14
|
+
})
|
15
|
+
|
16
|
+
if response
|
17
|
+
flash.notice = t('isaca.rails.user_consent.consent_submitted')
|
18
|
+
else
|
19
|
+
flash.alert = t('isaca.rails.user_consent.consent_failed')
|
20
|
+
end
|
21
|
+
|
13
22
|
redirect_after_sign_in_or(root_path)
|
14
23
|
else
|
15
24
|
render :show
|
@@ -1,25 +1,11 @@
|
|
1
1
|
module UserConsent
|
2
2
|
module Agreement
|
3
|
-
# Form object used for handling user consent
|
4
3
|
class FormObject
|
5
4
|
include ActiveModel::Model
|
6
5
|
|
7
6
|
attr_accessor :privacy_policy, :marketing_policy
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# Method used to report user consent of the privacy policy and marketing
|
13
|
-
#
|
14
|
-
# @param options [Hash] Optional. If not provided, marketing consent will default to NO [0].
|
15
|
-
#
|
16
|
-
# == Options
|
17
|
-
# [marketing] Consent for marketing. Acceptable values are 0 [for NO] and 1 [for YES].
|
18
|
-
#
|
19
|
-
# @return [Boolean] Whether or not the consent was successfully reported to ISACA
|
20
|
-
def report_consent(imis_id, options={})
|
21
|
-
Isaca::Request::ReportConsent.get(imis_id, options).success? if valid?
|
22
|
-
end
|
7
|
+
validates :privacy_policy, acceptance: {accept: %w(0 1)}, allow_nil: false
|
8
|
+
validates :marketing_policy, acceptance: {accept: %w(0 1)}, allow_nil: false
|
23
9
|
|
24
10
|
# Defining this method allows us to use some ActiveModel patterns. For example, forms will be identified
|
25
11
|
# as sign_in instead of session_sign_in_form_object.
|
@@ -14,6 +14,7 @@ en:
|
|
14
14
|
user_consent:
|
15
15
|
consent_required: Your consent is required before proceeding.
|
16
16
|
consent_submitted: You have successfully updated your privacy policy and marketing preferences.
|
17
|
+
consent_failed: An error occurred that prevented you from submitting your consent form.
|
17
18
|
administrators:
|
18
19
|
email_not_found: Could not find a record with the provided email.
|
19
20
|
created: Administrator was successfully created.
|
data/lib/isaca/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isaca-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Orahood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sass-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -303,8 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
303
|
- !ruby/object:Gem::Version
|
304
304
|
version: '0'
|
305
305
|
requirements: []
|
306
|
-
|
307
|
-
rubygems_version: 2.7.7
|
306
|
+
rubygems_version: 3.0.3
|
308
307
|
signing_key:
|
309
308
|
specification_version: 4
|
310
309
|
summary: Summary of Isaca::Rails.
|