aptible-auth 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aptible/auth/organization.rb +9 -0
- data/lib/aptible/auth/user.rb +4 -0
- data/lib/aptible/auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df3210695af43e5d27c23c0f37bba52806eb5f5c
|
|
4
|
+
data.tar.gz: 762d4d9ca811a0485a7f472c1fc4b421686df968
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abf09317d563268e246d0847e206546623990230c9c628ade7bd30214788b7d6f2bb9cd416ffa5ce6926a224303ce987dba87dea09809463bbb39b204ca1c927
|
|
7
|
+
data.tar.gz: bfce953fdbd4aed03ef4b9c1b7137db9dab7b3d8311281720a1c509caf1d108651a4d7dc017b0cb1d4e384710655b4dfa92414b30448863b46ca13ded97889c8
|
|
@@ -24,6 +24,15 @@ module Aptible
|
|
|
24
24
|
@stripe_customer ||= Stripe::Customer.retrieve(stripe_customer_id)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def billing_contact
|
|
28
|
+
return nil unless stripe_customer.metadata['billing_contact']
|
|
29
|
+
|
|
30
|
+
@billing_contact ||=
|
|
31
|
+
User.find_by_url(
|
|
32
|
+
stripe_customer.metadata['billing_contact'],
|
|
33
|
+
token: token)
|
|
34
|
+
end
|
|
35
|
+
|
|
27
36
|
def security_officer
|
|
28
37
|
# REVIEW: Examine underlying data model for a less arbitrary solution
|
|
29
38
|
security_officers_role = roles.find do |role|
|
data/lib/aptible/auth/user.rb
CHANGED
|
@@ -47,6 +47,10 @@ module Aptible
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# rubocop:disable PredicateName
|
|
50
|
+
def is_billing_contact?(organization)
|
|
51
|
+
organization.billing_contact && organization.billing_contact.id == id
|
|
52
|
+
end
|
|
53
|
+
|
|
50
54
|
def has_role?(role)
|
|
51
55
|
roles.select { |user_role| role.id == user_role.id }.count > 0
|
|
52
56
|
end
|
data/lib/aptible/auth/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aptible-auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Frank Macreery
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06-
|
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aptible-resource
|