petergate 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/petergate.rb +0 -22
- data/lib/petergate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7187ecf8f85815e545390c1d6990f5f86dd4b681
|
4
|
+
data.tar.gz: 9d7af8202338b5dccf7c44ff3e4aab8a6f48a090
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed8b2dcf4ad4e053c383f606c5f69c0feb2e6354c2d090448bf6f28a65971047b2d3e0074d4c08fd4f3be3bf1bc9f2437b4916de5bf09a9aae4b1e844dc8bf09
|
7
|
+
data.tar.gz: 89c02b9422e50a40032ceacb276f2a0dd258545d431b9cf7d19804c3ae153b4646a90a18a15e4599b19792dd04c5820acff52d12515fc72d001b2631e9f1c67f
|
data/Gemfile
CHANGED
data/lib/petergate.rb
CHANGED
@@ -52,26 +52,4 @@ module Petergate
|
|
52
52
|
# End Permissions
|
53
53
|
################################################################################
|
54
54
|
end
|
55
|
-
|
56
|
-
module User
|
57
|
-
serialize :roles
|
58
|
-
|
59
|
-
Roles = [:company, :service, :admin, :weak_admin]
|
60
|
-
|
61
|
-
after_initialize do
|
62
|
-
self[:roles] = []
|
63
|
-
end
|
64
|
-
|
65
|
-
def roles=(v)
|
66
|
-
self[:roles] = v.map(&:to_sym).to_a.select{|r| r.size > 0 && Roles.include?(r)}
|
67
|
-
end
|
68
|
-
|
69
|
-
def roles
|
70
|
-
self[:roles] + [:user]
|
71
|
-
end
|
72
|
-
|
73
|
-
def role
|
74
|
-
roles.first
|
75
|
-
end
|
76
|
-
end
|
77
55
|
end
|
data/lib/petergate/version.rb
CHANGED