card-mod-account 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '099e282c8620169f3afeed33d00a7491a35ee5b079b4dff6417f6da7230cfa7b'
4
- data.tar.gz: 0f31ebe2f9c281280b96fa73459f484506b5f86177aacbb61b439da9d01241ed
3
+ metadata.gz: 49cf11d996ab5f48def50e2a8eab078afa0786dd33c462e43032b59b05ded298
4
+ data.tar.gz: 4d8c08565a3f06def021a9dabf09195f66329e308b50024d691b72ce6d0069d9
5
5
  SHA512:
6
- metadata.gz: e1766764223124bc3f2622ea4983305c5fab30b26447a23678db4cf70c3dfd2aebd7aad6f14de1d4976aeaf71c29ddf2d774bc159da980f0b13da75c7d9c0f9f
7
- data.tar.gz: 26554ba732137d91d603b4489315cdeb9e333efa7868dddaf732312c0a81e812e0715633262a7bec316b0be30e6d27580f09f38957f96cdfba8007494b11ed28
6
+ metadata.gz: 1d79cc2bcdefda0931efb45faae41cfcd5299a42bf6082ae68c82302f31a364f6fe42ca97da2fada778de720e829ba8105a8996963af64901a51fc6003ab79b3
7
+ data.tar.gz: 547b9611e60a7e48b3410fd45f2c5ee89c6c9e1ca1ccfb273d5758f60a4331acc76f3d6d197303b93c9f8b6f2aec5f5dd5580b679ce495e170f657248993ab19
data/config/admin.yml ADDED
@@ -0,0 +1,4 @@
1
+ cardtypes:
2
+ admin:
3
+ - role
4
+ - signup
@@ -102,8 +102,9 @@ de:
102
102
  account_password_requirements: muss %{char_type} enthalten
103
103
  account_password_requirement_upper: einen Grossbuchstaben
104
104
  account_password_requirement_lower: einene Kleinbuchstaben
105
- account_password_requirement_special_char: ein Sonderzeichen (!@#$%^&*())
106
- account_password_requirement_number: eien Zahl
105
+ account_password_requirement_special_char: ein Sonderzeichen (wie !@$%&#)
106
+ account_password_requirement_number: eine Zahl
107
+ account_password_requirement_letter: einen Buchstaben
107
108
  account_password_missing: Passwort muss angegeben werden
108
109
  account_private_data: Private Daten
109
110
  account_reset_password: Password Zurücksetzen
@@ -17,12 +17,13 @@ en:
17
17
  account_invite: Invite
18
18
  account_missing_account: "ERROR: signup card missing account"
19
19
  account_or_sign_up: '...or sign up!'
20
- account_password_length: must be at least %{num_char} characters
20
+ account_password_length: must be %{num_char} characters or longer
21
21
  account_password_requirements: must contain %{char_type}
22
22
  account_password_requirement_upper: an upper case letter
23
23
  account_password_requirement_lower: a lower case letter
24
- account_password_requirement_special_char: a special character (!@#$%^&*())
24
+ account_password_requirement_special_char: a special character (like !@$%&#)
25
25
  account_password_requirement_number: a number
26
+ account_password_requirement_letter: a letter
26
27
  account_password_missing: password can't be blank
27
28
  account_private_data: Private data
28
29
  account_reset_password: Reset password
@@ -1,2 +1,2 @@
1
- // toggle_visiblity.js.coffee
2
- (function(){$(function(){var t,i;return t=$("input._toggle_password"),(i=$("span._toggle-password")).on("click",function(){return"password"===t.prop("type")?(t.prop("type","text"),i.find("i").text("visibility")):(t.prop("type","password"),i.find("i").text("visibility_off"))})})}).call(this);
1
+ // toggle_visibility.js.coffee
2
+ (function(){$(function(){return $("body").on("click","._toggle-pw-visibility",function(){var i,t;return i=$("._pw-input"),t=$("._pw-text-area"),"password"===i.prop("type")?(i.prop("type","text"),t.find("i").text("visibility")):(i.prop("type","password"),t.find("i").text("visibility_off"))})})}).call(this);
data/data/real.yml CHANGED
@@ -77,17 +77,21 @@
77
77
  - :type_plus_right
78
78
  - :update
79
79
  :content:
80
- Help Desk
80
+ - :help_desk
81
81
 
82
82
  - :name: "*account"
83
83
  :codename: account
84
84
  :fields:
85
85
  :right:
86
86
  :fields:
87
- :create: Administrator
88
- :read: Help Desk
89
- :update: Help Desk
90
- :delete: Help Desk
87
+ :create:
88
+ - :administrator
89
+ :read:
90
+ - :help_desk
91
+ :update:
92
+ - :help_desk
93
+ :delete:
94
+ - :help_desk
91
95
  :content: |-
92
96
  <div>When someone signs up, they create a [[Sign up]] card...</div>
93
97
  <blockquote>
@@ -119,31 +123,41 @@
119
123
  :fields:
120
124
  :right:
121
125
  :fields:
122
- :update: Help Desk
123
- :delete: Help Desk
124
- :read: Help Desk
126
+ :read:
127
+ - :help_desk
128
+ :update:
129
+ - :help_desk
130
+ :delete:
131
+ - :help_desk
125
132
  - :name: "*password"
126
133
  :codename: password
127
134
  :fields:
128
135
  :right:
129
136
  :fields:
130
- :update: Help Desk
131
- :delete: Help Desk
132
- :read: Help Desk
137
+ :read:
138
+ - :help_desk
139
+ :update:
140
+ - :help_desk
141
+ :delete:
142
+ - :help_desk
133
143
  - :name: "*salt"
134
144
  :codename: salt
135
145
  :fields:
136
146
  :right:
137
147
  :fields:
138
- :read: Help Desk
148
+ :read:
149
+ - :help_desk
139
150
  - :name: "*status"
140
151
  :codename: status
141
152
  :fields:
142
153
  :right:
143
154
  :fields:
144
- :update: Help Desk
145
- :delete: Help Desk
146
- :read: Help Desk
155
+ :read:
156
+ - :help_desk
157
+ :update:
158
+ - :help_desk
159
+ :delete:
160
+ - :help_desk
147
161
 
148
162
  - :name: "*account settings"
149
163
  :codename: account_settings
@@ -0,0 +1,7 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class MemberIds < Cardio::Migration::Transform
4
+ def up
5
+ Card.search(right: :members).each &:save!
6
+ end
7
+ end
@@ -1,11 +1,19 @@
1
- delegate :accounted, to: :account_card
1
+ # -*- encoding : utf-8 -*-
2
2
 
3
3
  def account_card
4
- left
4
+ left.tap { |l| return nil unless l.right_id == AccountID }
5
+ end
6
+
7
+ def accounted
8
+ account_card&.accounted
9
+ end
10
+
11
+ def own_account?
12
+ account_card&.own_account?
5
13
  end
6
14
 
7
15
  # allow account owner to update account field content
8
- def ok_to_update
16
+ def ok_to_update?
9
17
  (own_account? && !name_changed? && !type_id_changed?) || super
10
18
  end
11
19
 
@@ -0,0 +1,152 @@
1
+ event :validate_account_holder_name_change, :validate, on: :update, changed: :name do
2
+ return unless account? && !Card::Auth.as_card.account_manager?
3
+
4
+ errors.add :name, "cannot rename Account Holder"
5
+ end
6
+
7
+ def account
8
+ fetch :account, new: {}
9
+ end
10
+
11
+ def account?
12
+ account.real?
13
+ end
14
+
15
+ def own_account?
16
+ key == Auth.as_card.key
17
+ end
18
+
19
+ def default_account_status
20
+ "active"
21
+ end
22
+
23
+ def current_account?
24
+ id && Auth.current_id == id
25
+ end
26
+
27
+ def parties
28
+ @parties ||= (all_enabled_roles << id).flatten.reject(&:blank?)
29
+ end
30
+
31
+ def among? ok_ids
32
+ ok_ids.any? do |ok_id|
33
+ ok_id == AnyoneID ||
34
+ # (ok_id == AnyoneWithRoleID && all_enabled_roles.size > 1) ||
35
+ parties.member?(ok_id)
36
+ end
37
+ end
38
+
39
+ def all_enabled_roles
40
+ @all_enabled_roles ||= (id == AnonymousID ? [] : enabled_role_ids)
41
+ end
42
+
43
+ def all_roles
44
+ @all_roles ||= (id == AnonymousID ? [] : fetch_roles)
45
+ end
46
+
47
+ def read_rules
48
+ @read_rules ||= fetch_read_rules
49
+ end
50
+
51
+ def read_rules_hash
52
+ @read_rules_hash ||= read_rules.each_with_object({}) { |id, h| h[id] = true }
53
+ end
54
+
55
+ def clear_roles
56
+ @parties = @all_roles = @all_enabled_roles = @read_rules = nil
57
+ end
58
+
59
+ def ok_to_update?
60
+ (own_account? && !type_id_changed?) || super
61
+ end
62
+
63
+ def admin?
64
+ role? AdministratorID
65
+ end
66
+
67
+ def role? role_mark
68
+ all_enabled_roles.include? role_mark.card_id
69
+ end
70
+
71
+ def account_manager?
72
+ own_account? || parties.member?(HelpDeskID)
73
+ end
74
+
75
+ private
76
+
77
+ def enabled_role_ids
78
+ with_enabled_roles do |enabled|
79
+ enabled.virtual? ? enabled.item_ids : fetch_roles
80
+ end
81
+ end
82
+
83
+ def with_enabled_roles
84
+ Auth.as_bot do
85
+ Card::Codename.exists?(:enabled_roles) ? yield(enabled_roles_card) : fetch_roles
86
+ end
87
+ end
88
+
89
+ def enabled_roles_card
90
+ fetch :enabled_roles, eager_cache: true, new: { type_id: SessionID }
91
+ end
92
+
93
+ def role_ids_from_role_member_cards
94
+ Self::Role.role_ids id
95
+ end
96
+
97
+ def fetch_roles
98
+ [AnyoneSignedInID] + role_ids_from_role_member_cards
99
+ end
100
+
101
+ def fetch_read_rules
102
+ return [] if id == WagnBotID # always_ok, so not needed
103
+
104
+ ([AnyoneID] + parties).each_with_object([]) do |party_id, rule_ids|
105
+ next unless (cache = Card::Rule.read_rule_cache[party_id])
106
+
107
+ rule_ids.concat cache
108
+ end
109
+ end
110
+
111
+ format :html do
112
+ def default_board_tab
113
+ card.current_account? ? :account_tab : super
114
+ end
115
+
116
+ view :account_tab do
117
+ board_pill_sections "Account" do
118
+ [["Settings", account_details_items],
119
+ ["Content", account_content_items]]
120
+ end
121
+ end
122
+
123
+ def show_account_tab?
124
+ card.account?
125
+ end
126
+
127
+ def account_formgroups
128
+ Auth.as_bot do
129
+ subformat(card.account)._render :content_formgroups, structure: true
130
+ end
131
+ end
132
+
133
+ def account_details_items
134
+ [
135
+ ["Email and Password", :account,
136
+ { path: { slot: { hide: %i[help_link board_link] } } }],
137
+ ["Roles", :roles,
138
+ { path: { view: :content } }],
139
+ ["Notifications", :follow],
140
+ # FIXME: this should be added in api_key mod!
141
+ ["API", :account,
142
+ { path: { view: :api_key,
143
+ items: { view: :content },
144
+ slot: { hide: %i[help_link board_link] } } }]
145
+ ]
146
+ end
147
+
148
+ def account_content_items
149
+ [["Created", :created],
150
+ ["Edited", :edited]]
151
+ end
152
+ end
data/set/all/account.rb CHANGED
@@ -5,92 +5,11 @@ module ClassMethods
5
5
  end
6
6
 
7
7
  def account
8
- fetch :account
8
+ nil
9
9
  end
10
10
 
11
- def parties
12
- @parties ||= (all_enabled_roles << id).flatten.reject(&:blank?)
13
- end
14
-
15
- def among? ok_ids
16
- ok_ids.any? do |ok_id|
17
- ok_id == AnyoneID ||
18
- # (ok_id == AnyoneWithRoleID && all_enabled_roles.size > 1) ||
19
- parties.member?(ok_id)
20
- end
21
- end
22
-
23
- def own_account?
24
- # card is +*account card of signed_in user.
25
- name.part_names[0].key == Auth.as_card.key &&
26
- name.part_names[1].key == Card[:account].key
27
- end
28
-
29
- def read_rules
30
- @read_rules ||= fetch_read_rules
31
- end
32
-
33
- def read_rules_hash
34
- @read_rules_hash ||= read_rules.each_with_object({}) { |id, h| h[id] = true }
35
- end
36
-
37
- def fetch_read_rules
38
- return [] if id == WagnBotID # always_ok, so not needed
39
-
40
- ([AnyoneID] + parties).each_with_object([]) do |party_id, rule_ids|
41
- next unless (cache = Card::Rule.read_rule_cache[party_id])
42
-
43
- rule_ids.concat cache
44
- end
45
- end
46
-
47
- def clear_roles
48
- @parties = @all_roles = @all_active_roles = @read_rules = nil
49
- end
50
-
51
- # def with_clear_roles
52
- # a = @parties
53
- # b = @all_roles
54
- # c = @all_active_roles
55
- # d = @read_rules
56
- # yield
57
- # ensure
58
- # @parties = a
59
- # @all_roles = b
60
- # @all_active_roles = c
61
- # @read_rules = d
62
- # end
63
-
64
- def all_enabled_roles
65
- @all_active_roles ||= (id == AnonymousID ? [] : enabled_role_ids)
66
- end
67
-
68
- def all_roles
69
- @all_roles ||= (id == AnonymousID ? [] : fetch_roles)
70
- end
71
-
72
- def enabled_role_ids
73
- with_enabled_roles do |enabled|
74
- enabled.virtual? ? enabled.item_ids : fetch_roles
75
- end
76
- end
77
-
78
- def with_enabled_roles
79
- Auth.as_bot do
80
- Card::Codename.exists?(:enabled_roles) ? yield(enabled_roles_card) : fetch_roles
81
- end
82
- end
83
-
84
- def enabled_roles_card
85
- fetch :enabled_roles, eager_cache: true, new: { type_id: SessionID }
86
- end
87
-
88
- def fetch_roles
89
- [AnyoneSignedInID] + role_ids_from_role_member_cards
90
- end
91
-
92
- def role_ids_from_role_member_cards
93
- Self::Role.role_ids id
11
+ def account?
12
+ false
94
13
  end
95
14
 
96
15
  event :generate_token do
@@ -1,3 +1,6 @@
1
- %input.form-control.d0-card-content._pw-input{name: "card[subcards][+#{:password.cardname}][content]", type: "password", placeholder: "Password"}
1
+
2
+ = password_field :content, class: "d0-card-content _pw-input",
3
+ placeholder: "Password",
4
+ autocomplete: "off"
2
5
  %span._toggle-password.visibility-icon._pw-text-area
3
6
  = icon_tag :hide_password, class: "_toggle-pw-visibility"
@@ -54,7 +54,7 @@ end
54
54
  def verifying_token success, failure
55
55
  requiring_token do |token|
56
56
  result = Auth::Token.decode token
57
- if result.is_a?(String)
57
+ if result.is_a?(String) || (result[:user_id] != accounted_id)
58
58
  send failure, result
59
59
  else
60
60
  send success
data/set/right/account.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
+ delegate :own_account?, to: :accounted
4
+
3
5
  card_accessor :email
4
6
  card_accessor :password
5
7
  card_accessor :salt
@@ -15,12 +17,12 @@ def accounted_id
15
17
  left_id
16
18
  end
17
19
 
18
- def ok_to_read
20
+ def ok_to_read?
19
21
  own_account? || super
20
22
  end
21
23
 
22
24
  # allow account owner to update account field content
23
- def ok_to_update
25
+ def ok_to_update?
24
26
  (own_account? && !name_changed? && !type_id_changed?) || super
25
27
  end
26
28
 
data/set/right/email.rb CHANGED
@@ -36,7 +36,7 @@ def email_required?
36
36
  !left&.left&.codename == :wagn_bot
37
37
  end
38
38
 
39
- def ok_to_read
39
+ def ok_to_read?
40
40
  if own_email? || Auth.always_ok?
41
41
  true
42
42
  else
@@ -5,15 +5,16 @@ assign_type :phrase
5
5
  PASSWORD_REGEX = {
6
6
  lower: /[a-z]/,
7
7
  upper: /[A-Z]/,
8
- special_char: /[!@#$%^&*()]/,
9
- number: /\d+/
8
+ special_char: /[!"#$%&'()*+,-.\/:;<=>?@\[\]\\^_`{|}~]/,
9
+ number: /\d+/,
10
+ letter: /[a-zA-Z]/
10
11
  }.freeze
11
12
 
12
13
  def history?
13
14
  false
14
15
  end
15
16
 
16
- def ok_to_read
17
+ def ok_to_read?
17
18
  own_account? || super
18
19
  end
19
20
 
data/set/right/status.rb CHANGED
@@ -13,7 +13,7 @@ def option_names
13
13
  %w[unapproved unverified active blocked] # system
14
14
  end
15
15
 
16
- def ok_to_update
16
+ def ok_to_update?
17
17
  if own_account? && !Auth.always_ok?
18
18
  deny_because you_cant(t(:account_deny_not_change_own_account))
19
19
  else
@@ -0,0 +1,13 @@
1
+ include_set Abstract::AccountHolder
2
+
3
+ def account
4
+ nil
5
+ end
6
+
7
+ def account?
8
+ false
9
+ end
10
+
11
+ def admin?
12
+ false
13
+ end
data/set/self/signin.rb CHANGED
@@ -34,7 +34,7 @@ def email_from_field
34
34
  @email_from_field ||= field_content(:email)
35
35
  end
36
36
 
37
- def ok_to_read
37
+ def ok_to_read?
38
38
  true
39
39
  end
40
40
 
@@ -0,0 +1,5 @@
1
+ include_set Abstract::AccountHolder
2
+
3
+ def admin?
4
+ true
5
+ end
data/set/type/role.rb CHANGED
@@ -9,6 +9,20 @@ format :html do
9
9
  role_checkbox
10
10
  end
11
11
 
12
+ view :configs do
13
+ configs_by_cat = card.all_admin_configs_grouped_by(:roles, :category)[card.codename]
14
+ configs_by_cat.map do |(cat, configs)|
15
+ if cat == "cardtypes"
16
+ nested_list_section cat.capitalize,
17
+ card.config_codenames_grouped_by_title(configs)
18
+ elsif cat == "views"
19
+ next
20
+ else
21
+ list_section cat.capitalize, configs.map { |c| c.codename.to_sym }, :closed_bar
22
+ end
23
+ end
24
+ end
25
+
12
26
  def role_checkbox
13
27
  name = card.disabled? ? "add_item" : "drop_item"
14
28
  subformat(Auth.current.field(:disabled_roles)).card_form :update do
@@ -45,7 +45,7 @@ format :html do
45
45
  end
46
46
 
47
47
  def account_lines
48
- if card.account
48
+ if card.account?
49
49
  verification_lines
50
50
  else
51
51
  [t(:account_missing_account)]
data/set/type/signup.rb CHANGED
@@ -1,4 +1,4 @@
1
- include_set Abstract::Accountable
1
+ include_set Abstract::AccountHolder
2
2
 
3
3
  basket[:non_createable_types] << :signup
4
4
 
data/set/type/user.rb CHANGED
@@ -1,11 +1,13 @@
1
- include_set Abstract::Accountable
1
+ include_set Abstract::AccountHolder
2
+
3
+ basket[:roles_for_first_user] = %i[help_desk shark administrator]
2
4
 
3
5
  attr_accessor :email
4
6
 
5
7
  format :html do
6
8
  delegate :needs_setup?, to: Card::Auth
7
9
 
8
- view :setup, unknown: true, perms: :needs_setup? do
10
+ view :setup, unknown: true, perms: :needs_setup?, cache: :never do
9
11
  with_nest_mode :edit do
10
12
  voo.title = "Your deck is ready to go!" # LOCALIZE
11
13
  voo.show! :help
@@ -36,37 +38,37 @@ format :html do
36
38
 
37
39
  def setup_hidden_fields
38
40
  hidden_tags(
39
- setup: true,
40
- success: { redirect: true, mark: path(mark: "") },
41
- "card[type_id]" => Card.default_accounted_type_id
41
+ card: {
42
+ type_id: Card.default_accounted_type_id,
43
+ trigger: %w[check_setup]
44
+ },
45
+ success: { redirect: true, mark: path(mark: "") }
42
46
  )
43
47
  end
44
48
  end
45
49
 
46
- # FIXME. use trigger
47
- def setup?
48
- Card::Env.params[:setup]
49
- end
50
-
51
- event :setup_as_bot, before: :check_permissions, on: :create, when: :setup? do
50
+ event :check_setup, before: :check_permissions, on: :create, trigger: :required do
52
51
  abort :failure unless Auth.needs_setup?
53
52
  Auth.as_bot
53
+ @setup_approved = true
54
54
  # we need bot authority to set the initial administrator roles
55
55
  # this is granted and inspected here as a separate event for
56
56
  # flexibility and security when configuring initial setups
57
57
  end
58
58
 
59
- event :setup_first_user, :prepare_to_store, on: :create, when: :setup? do
59
+ event :setup_first_user, :finalize, on: :create, when: :setup? do
60
60
  subcard %i[signup_alert_email to].cardname, content: name
61
- roles_for_first_user.each do |role|
62
- subcard [role, :members], content: name
61
+ basket[:roles_for_first_user].map(&:cardname).each do |role|
62
+ subcard [role, :members].cardname, content: name
63
63
  end
64
64
  end
65
65
 
66
- def roles_for_first_user
67
- %i[help_desk shark administrator].map(&:cardname)
68
- end
69
-
70
66
  event :signin_after_setup, :integrate, on: :create, when: :setup? do
71
67
  Auth.signin id
72
68
  end
69
+
70
+ private
71
+
72
+ def setup?
73
+ @setup_approved == true
74
+ end
@@ -0,0 +1,5 @@
1
+ # needed because of the present of Set cards like Signup+account, which
2
+ # are not true account cards.
3
+ def own_account?
4
+ false
5
+ end
@@ -1,3 +1,5 @@
1
+ include_set Abstract::IdList
2
+
1
3
  assign_type :list
2
4
 
3
5
  event :update_role_cache, :finalize do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-account
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-11-18 00:00:00.000000000 Z
13
+ date: 2024-06-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,84 +18,84 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.106.0
21
+ version: 1.107.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.106.0
28
+ version: 1.107.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-email
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.16.0
35
+ version: 0.17.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.16.0
42
+ version: 0.17.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-permissions
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.16.0
49
+ version: 0.17.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.16.0
56
+ version: 0.17.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: card-mod-list
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.16.0
63
+ version: 0.17.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.16.0
70
+ version: 0.17.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: card-mod-integrate
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.16.0
77
+ version: 0.17.0
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.16.0
84
+ version: 0.17.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: card-mod-edit
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.16.0
91
+ version: 0.17.0
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.16.0
98
+ version: 0.17.0
99
99
  description: ''
100
100
  email:
101
101
  - info@decko.org
@@ -107,14 +107,16 @@ files:
107
107
  - README.md
108
108
  - assets/script/toggle_visibility.js.coffee
109
109
  - assets/style/account.scss
110
+ - config/admin.yml
110
111
  - config/locales/de.yml
111
112
  - config/locales/en.yml
112
113
  - data/files/mod_account_script_asset_output/file.js
113
114
  - data/real.yml
114
115
  - data/transform/20220815112551_move_roles.rb
116
+ - data/transform/20240510141851_member_ids.rb
115
117
  - lib/card/mod/account.rb
116
118
  - set/abstract/account_field.rb
117
- - set/abstract/accountable.rb
119
+ - set/abstract/account_holder.rb
118
120
  - set/all/account.rb
119
121
  - set/all/password_input.haml
120
122
  - set/all/password_input.rb
@@ -126,15 +128,18 @@ files:
126
128
  - set/right/roles.rb
127
129
  - set/right/salt.rb
128
130
  - set/right/status.rb
131
+ - set/self/anonymous.rb
129
132
  - set/self/role.rb
130
133
  - set/self/signin.rb
131
134
  - set/self/signin/core.haml
135
+ - set/self/wagn_bot.rb
132
136
  - set/type/role.rb
133
137
  - set/type/signup.rb
134
138
  - set/type/signup/core.haml
135
139
  - set/type/signup/views.rb
136
140
  - set/type/user.rb
137
141
  - set/type/user/setup_help.haml
142
+ - set/type_plus_right/cardtype/account.rb
138
143
  - set/type_plus_right/role/members.rb
139
144
  - set/type_plus_right/user/email.rb
140
145
  homepage: https://decko.org
@@ -156,14 +161,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
161
  requirements:
157
162
  - - ">="
158
163
  - !ruby/object:Gem::Version
159
- version: '2.5'
164
+ version: '3.0'
160
165
  required_rubygems_version: !ruby/object:Gem::Requirement
161
166
  requirements:
162
167
  - - ">="
163
168
  - !ruby/object:Gem::Version
164
169
  version: '0'
165
170
  requirements: []
166
- rubygems_version: 3.4.10
171
+ rubygems_version: 3.5.10
167
172
  signing_key:
168
173
  specification_version: 4
169
174
  summary: Email-based account handling for decko cards
@@ -1,54 +0,0 @@
1
- def account
2
- fetch :account, new: {}
3
- end
4
-
5
- def default_account_status
6
- "active"
7
- end
8
-
9
- def current_account?
10
- id && Auth.current_id == id
11
- end
12
-
13
- format :html do
14
- def default_board_tab
15
- card.current_account? ? :account_tab : super
16
- end
17
-
18
- view :account_tab do
19
- board_pill_sections "Account" do
20
- [["Settings", account_details_items],
21
- ["Content", account_content_items]]
22
- end
23
- end
24
-
25
- def show_account_tab?
26
- card.account.real?
27
- end
28
-
29
- def account_formgroups
30
- Auth.as_bot do
31
- subformat(card.account)._render :content_formgroups, structure: true
32
- end
33
- end
34
-
35
- def account_details_items
36
- [
37
- ["Email and Password", :account,
38
- { path: { slot: { hide: %i[help_link board_link] } } }],
39
- ["Roles", :roles,
40
- { path: { view: :content } }],
41
- ["Notifications", :follow],
42
- # FIXME: this should be added in api_key mod!
43
- ["API", :account,
44
- { path: { view: :api_key,
45
- items: { view: :content },
46
- slot: { hide: %i[help_link board_link] } } }]
47
- ]
48
- end
49
-
50
- def account_content_items
51
- [["Created", :created],
52
- ["Edited", :edited]]
53
- end
54
- end