thecore_auth_commons 3.0.10 → 3.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/permission.rb +3 -3
- data/db/seeds.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75c8351339623ea4fd13daf13e0fa5c6bad69cec8a74b7222ccd228098c48e82
|
4
|
+
data.tar.gz: 070405ac9ed1fa492d2dfffdeca3e286835e89fccdaf4f27f00f4e98b83632e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0636ff4d42321cccc6423e1f53cda949cc7fd64c2b86e4d856c47baf38243421c3de5c5c0525796c6c9a084da4fdb5e00db6dee092b4f6f63dbadd3bfc44aa1
|
7
|
+
data.tar.gz: 4f81899e74c48352921746583dc6a81362744bb57e3e417d658c9a4bd7ea0eb88381d853971ed64270430d7f59e00abe2feb5e0bb4a2931d6ffbca69681f43ba
|
data/app/models/permission.rb
CHANGED
@@ -12,9 +12,9 @@ class Permission < ApplicationRecord
|
|
12
12
|
validates :target_id, presence: true
|
13
13
|
|
14
14
|
def display_name
|
15
|
-
|
15
|
+
pr = (I18n.t "permissions.predicates.#{predicate.name}", default: predicate.name.titleize rescue nil)
|
16
16
|
a = (I18n.t "permissions.actions.#{action.name}", default: action.name.titleize rescue nil)
|
17
|
-
m = (I18n.t "activerecord.models.#{target.name}", default: target.name.titleize rescue nil)
|
18
|
-
[
|
17
|
+
m = (I18n.t "activerecord.models.#{target.name}", count: 2, default: target.name.titleize rescue nil)
|
18
|
+
[ pr, a, m ].join(" ")
|
19
19
|
end
|
20
20
|
end
|
data/db/seeds.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
puts "Loading ThecoreAuthCommons seeds"
|
2
|
-
email = "admin@#{ENV["BASE_DOMAIN"]}"
|
2
|
+
email = "admin@#{ENV["BASE_DOMAIN"].presence || "example.com"}"
|
3
3
|
psswd = ENV["ADMIN_PASSWORD"].presence || "changeme"
|
4
4
|
|
5
5
|
unless User.where(admin: true).exists?
|
@@ -12,7 +12,7 @@ end
|
|
12
12
|
@values = {
|
13
13
|
predicates: %i[can cannot],
|
14
14
|
actions: %i[manage create read update destroy],
|
15
|
-
targets: ApplicationRecord.subclasses.map {|d| d.to_s.underscore}.to_a.unshift(
|
15
|
+
targets: ApplicationRecord.subclasses.map {|d| d.to_s.underscore}.to_a.unshift("all")
|
16
16
|
}
|
17
17
|
|
18
18
|
def fill table
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_auth_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
requirements: []
|
228
|
-
rubygems_version: 3.4.
|
228
|
+
rubygems_version: 3.4.10
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Common Auth methods and models to be used in thecore components.
|