egov_utils 0.3.9 → 0.3.10

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: 91a41a52aa16a737cdca92ecbf8828ba6a62e8a8ddb9a935d603bc49655eb906
4
- data.tar.gz: 34244798bfa65ce51f5ecd758b7595e75bfd37efed6befc0e7fc355853b876e8
3
+ metadata.gz: 36bbca48a22bfa3f235771d19b8fceae9f6b9c5ab9819c79b136088c356e83ca
4
+ data.tar.gz: 665ff8af88d1a37e1bffb0a3eb6ce301236e8ccb3bc19bfc607fcf532067de1d
5
5
  SHA512:
6
- metadata.gz: '0835b1e2c4894906fd621c39ed989af6dce3fe0cfdb94247a827a14852c409d60010ee6dd2f9ceafbf5119f700fe55b27052dfbaffdc9097e87900760d0c6ccc'
7
- data.tar.gz: cbc9623f6a67b1dc92a4075fab48ccd2ce519e3076a7b1c0557acbb490e27660279ae22e445e58edfbaa72fcfb4418f5adb7874a6021a56e38da9eb84143ad4e
6
+ metadata.gz: 14c5bf67f6f723d5b28a693799314464a64887d7fba6792e9118016105fef9c76f868c21f27e7eac43a87f00634b9552279cbb739c3f9136e441887782c07353
7
+ data.tar.gz: 6bd549656e6bfb9b3e782d7125e38838de680133ee5b3eddeaa5d6535f78bc1bda71659253735b78edb06f33449a5c35787340d4ed8c6fc3ffa75e07210e54f4
@@ -15,7 +15,7 @@ module EgovUtils
15
15
  def send_reset_token
16
16
  return render_404 unless EgovUtils::Settings.allow_password_reset?
17
17
  @user = EgovUtils::User.find_by(mail: params[:reset_password][:mail])
18
- if @user
18
+ if @user && @user.password_change_possible?
19
19
  @token = @user.generate_reset_password_token
20
20
  EgovUtils::UserMailer.password_reset(@user, @token).deliver_later if @user.save
21
21
  end
@@ -6,14 +6,15 @@ module EgovUtils
6
6
 
7
7
  skip_before_action :require_login, only: [:new, :create, :confirm]
8
8
 
9
- authorize_resource only: :index
10
- load_and_authorize_resource only: [:new, :create, :show, :destroy]
9
+ load_and_authorize_resource
11
10
 
12
11
  def index
13
12
  providers
14
- @users = EgovUtils::User.accessible_by(current_ability).order(:provider)
15
13
  @groups = EgovUtils::Group.accessible_by(current_ability).order(:provider)
16
14
  @new_user = EgovUtils::User.new(generate_password: true)
15
+ azahara_schema_index do |users|
16
+ users.add_sort('provider')
17
+ end
17
18
  end
18
19
 
19
20
  def new
@@ -5,6 +5,10 @@ module EgovUtils
5
5
  'fullname'
6
6
  end
7
7
 
8
+ def default_columns
9
+ ['fullname', 'provider', 'roles', 'groups']
10
+ end
11
+
8
12
  def initialize_available_attributes
9
13
  @available_attributes ||= []
10
14
  @available_attributes << AzaharaSchema::DerivedAttribute.new(model, 'fullname', :concat, 'lastname', 'firstname', schema: self)
@@ -7,9 +7,9 @@
7
7
  %th= EgovUtils::User.human_attribute_name('groups')
8
8
  %th= t('label_actions')
9
9
  %tbody
10
- - users.each do |user|
10
+ - users.entities.each do |user|
11
11
  %tr
12
- %td= user.fullname
12
+ %td{title: user.login}= user.fullname
13
13
  %td= user.provider
14
14
  - if can?(:manage, user)
15
15
  %td.roles{data: {roles: user.roles, id: user.id}}= user.roles.join(', ')
@@ -19,7 +19,8 @@
19
19
  - user.groups.each do |g|
20
20
  %span= g.name
21
21
  %td
22
- = button_to(t('label_delete'), user_path(user), method: :delete, class: 'btn btn-warning btn-sm')
22
+ - if can?(:delete, user)
23
+ = button_to(t('label_delete'), user_path(user), method: :delete, class: 'btn btn-warning btn-sm')
23
24
  - unless user.active?
24
25
  = button_to(t('label_approve'), approve_user_path(user), class: 'btn btn-primary btn-sm')
25
26
 
@@ -11,12 +11,16 @@ module EgovUtils
11
11
 
12
12
  # namespace Rails.env
13
13
 
14
+ def allow_internal_accounts?
15
+ true
16
+ end
17
+
14
18
  def allow_register?
15
- allow_register
19
+ allow_internal_accounts? && allow_register
16
20
  end
17
21
 
18
22
  def allow_password_reset?
19
- allow_register? && allow_password_reset
23
+ allow_internal_accounts? && allow_password_reset
20
24
  end
21
25
 
22
26
  end
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -675,7 +675,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
675
675
  version: '0'
676
676
  requirements: []
677
677
  rubyforge_project:
678
- rubygems_version: 2.7.6
678
+ rubygems_version: 2.7.7
679
679
  signing_key:
680
680
  specification_version: 4
681
681
  summary: The eGoverment utilities is set of functionalities to support basic eGoverment