thecore_auth_commons 3.0.5 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/user.rb +1 -4
- data/config/initializers/after_initialize.rb +2 -2
- data/db/migrate/20160208110805_devise_create_users.rb +5 -5
- data/db/migrate/20160209152753_add_trackable_to_user.rb +5 -5
- data/db/migrate/20160209153229_add_admin_to_user.rb +1 -1
- data/db/migrate/20160209153326_add_lock_version_to_user.rb +1 -1
- data/db/migrate/20160209153406_add_locked_to_user.rb +1 -1
- data/db/migrate/20160209153533_add_access_token_to_user.rb +1 -1
- data/db/migrate/20160209153811_create_roles.rb +2 -2
- data/db/migrate/20160209153813_create_role_users.rb +1 -1
- data/db/migrate/20160209153816_create_permissions_chain.rb +9 -9
- data/db/seeds.rb +0 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cd52f88583bd526c64a26eafe79e9f246766714f8d48b28a894ba885cc7d22a
|
4
|
+
data.tar.gz: 90003d281f2247e26b922b7fa8bfb8d8d63dc03e44c6151646ae6d172af8fabf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5565d62ec1ea44e874757af506cdeedf81d129cc8638442ede6171994f6d6bdc999131080d75f10c7a41cbf5d23914d3917e2dc88f826d13cfb0f60fc1ff5321
|
7
|
+
data.tar.gz: 84a0577201c562fd5112db9a04085d3eca695718b5738ca3b0d635c1a9f77a73aff7658b8fdcb3e0a38120f377859cc9fcc252370198714b06220b1a0ef2ba66
|
data/app/models/user.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
1
|
class User < ApplicationRecord
|
2
|
-
|
3
|
-
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
4
|
-
devise :database_authenticatable, :registerable,
|
5
|
-
:recoverable, :rememberable, :validatable
|
2
|
+
devise :database_authenticatable, :rememberable, :validatable
|
6
3
|
end
|
@@ -6,7 +6,7 @@ Rails.application.configure do
|
|
6
6
|
|
7
7
|
Ability.send(:include, ThecoreAuthCommonsCanCanCanConcern)
|
8
8
|
User.send(:include, ThecoreAuthCommonsUserConcern)
|
9
|
-
User.devise_modules.delete(:recoverable) if ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.raw == "disable"
|
10
|
-
User.devise_modules.delete(:registerable) if ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.raw == "disable"
|
9
|
+
# User.devise_modules.delete(:recoverable) if ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.raw == "disable"
|
10
|
+
# User.devise_modules.delete(:registerable) if ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.raw == "disable"
|
11
11
|
end
|
12
12
|
end
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
class DeviseCreateUsers < ActiveRecord::Migration[7.0]
|
4
4
|
def change
|
5
|
-
create_table :users do |t|
|
5
|
+
create_table :users, if_not_exists: true do |t|
|
6
6
|
## Database authenticatable
|
7
7
|
t.string :email, null: false, default: ""
|
8
8
|
t.string :encrypted_password, null: false, default: ""
|
9
9
|
|
10
10
|
## Recoverable
|
11
|
-
t.string :reset_password_token
|
12
|
-
t.datetime :reset_password_sent_at
|
11
|
+
# t.string :reset_password_token
|
12
|
+
# t.datetime :reset_password_sent_at
|
13
13
|
|
14
14
|
## Rememberable
|
15
15
|
t.datetime :remember_created_at
|
@@ -36,8 +36,8 @@ class DeviseCreateUsers < ActiveRecord::Migration[7.0]
|
|
36
36
|
t.timestamps null: false
|
37
37
|
end
|
38
38
|
|
39
|
-
add_index :users, :email, unique: true
|
40
|
-
add_index :users, :reset_password_token, unique: true
|
39
|
+
add_index :users, :email, unique: true, if_not_exists: true
|
40
|
+
# add_index :users, :reset_password_token, unique: true, if_not_exists: true
|
41
41
|
# add_index :users, :confirmation_token, unique: true
|
42
42
|
# add_index :users, :unlock_token, unique: true
|
43
43
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class AddTrackableToUser < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
|
-
add_column :users, :sign_in_count, :bigint, default: 0, null: false
|
4
|
-
add_column :users, :current_sign_in_at, :datetime
|
5
|
-
add_column :users, :last_sign_in_at, :datetime
|
6
|
-
add_column :users, :current_sign_in_ip, :string
|
7
|
-
add_column :users, :last_sign_in_ip, :string
|
3
|
+
add_column :users, :sign_in_count, :bigint, default: 0, null: false, if_not_exists: true
|
4
|
+
add_column :users, :current_sign_in_at, :datetime, if_not_exists: true
|
5
|
+
add_column :users, :last_sign_in_at, :datetime, if_not_exists: true
|
6
|
+
add_column :users, :current_sign_in_ip, :string, if_not_exists: true
|
7
|
+
add_column :users, :last_sign_in_ip, :string, if_not_exists: true
|
8
8
|
end
|
9
9
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
class CreateRoles < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
|
-
create_table :roles do |t|
|
3
|
+
create_table :roles, if_not_exists: true do |t|
|
4
4
|
t.string :name
|
5
5
|
t.bigint :lock_version
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :roles, :name, unique: true
|
9
|
+
add_index :roles, :name, unique: true, if_not_exists: true
|
10
10
|
end
|
11
11
|
end
|
@@ -1,33 +1,33 @@
|
|
1
|
-
class CreatePermissionsChain < ActiveRecord::Migration[
|
1
|
+
class CreatePermissionsChain < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
3
|
# Predicates
|
4
|
-
create_table :predicates do |t|
|
4
|
+
create_table :predicates, if_not_exists: true do |t|
|
5
5
|
t.string :name
|
6
6
|
t.bigint :lock_version
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :predicates, :name, unique: true
|
10
|
+
add_index :predicates, :name, unique: true, if_not_exists: true
|
11
11
|
|
12
12
|
# Actions
|
13
|
-
create_table :actions do |t|
|
13
|
+
create_table :actions, if_not_exists: true do |t|
|
14
14
|
t.string :name
|
15
15
|
t.bigint :lock_version
|
16
16
|
|
17
17
|
t.timestamps
|
18
18
|
end
|
19
|
-
add_index :actions, :name, unique: true
|
19
|
+
add_index :actions, :name, unique: true, if_not_exists: true
|
20
20
|
|
21
21
|
# Targets
|
22
|
-
create_table :targets do |t|
|
22
|
+
create_table :targets, if_not_exists: true do |t|
|
23
23
|
t.string :name
|
24
24
|
t.bigint :lock_version
|
25
25
|
|
26
26
|
t.timestamps
|
27
27
|
end
|
28
|
-
add_index :targets, :name, unique: true
|
28
|
+
add_index :targets, :name, unique: true, if_not_exists: true
|
29
29
|
|
30
|
-
create_table :permissions do |t|
|
30
|
+
create_table :permissions, if_not_exists: true do |t|
|
31
31
|
t.references :predicate, null: false, foreign_key: true
|
32
32
|
t.references :action, null: false, foreign_key: true
|
33
33
|
t.references :target, null: false, foreign_key: true
|
@@ -36,7 +36,7 @@ class CreatePermissionsChain < ActiveRecord::Migration[6.0]
|
|
36
36
|
t.timestamps
|
37
37
|
end
|
38
38
|
# Association table
|
39
|
-
create_table :permission_roles do |t|
|
39
|
+
create_table :permission_roles, if_not_exists: true do |t|
|
40
40
|
t.references :role, null: false, foreign_key: true
|
41
41
|
t.references :permission, null: false, foreign_key: true
|
42
42
|
t.bigint :lock_version
|
data/db/seeds.rb
CHANGED