bearcat 1.0.21 → 1.0.22

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
  SHA1:
3
- metadata.gz: 07ee26b5b5644db55d1411270eee4fa65c72b7ec
4
- data.tar.gz: 252d35246ec76da5b18d686d4b8b6e446d8be779
3
+ metadata.gz: bad8e6053ae792a9423894d9939edb8c51e0337f
4
+ data.tar.gz: aef2d6ac2d0f7ef677c99c237e7bd683c023db1f
5
5
  SHA512:
6
- metadata.gz: c981f0dc5d187addef5f2f00a9019536808eba977c4dc1225a674d073529ebd7922ed815c7b2eed4706d59b097631a5d87950c54c3cc0059fb8461fc350706f8
7
- data.tar.gz: ac6a668f73aab8ee4188d40b5eebe21fd9b920f0c38df4f4862caccc85c8104afdb7a161e9c08d175526052ea553fb4280d6c6ac4a84c58180ad6791551739b4
6
+ metadata.gz: 9f834d75a836097011646067cbfb7585bc0f7e62a8336620d451cdb3872b0540eed90c8a0ff2ca2db22268a79502166ad534ce35521742f347a16a5ade63b527
7
+ data.tar.gz: 98bcc04bda74495210fbc260251450d1cd745a9267e338b5772247e2bc33c3dc97c9c398064b48585c2fcc9c45c13b035277d212f6badfd2d56c0553ad2de3a8
@@ -18,6 +18,10 @@ module Bearcat
18
18
  get("/api/v1/accounts/#{account}/admins", params)
19
19
  end
20
20
 
21
+ def account_roles(account, params = {})
22
+ get("/api/v1/accounts/#{account}/roles", params)
23
+ end
24
+
21
25
  end
22
26
  end
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.21' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.22' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -36,4 +36,15 @@ describe Bearcat::Client::Accounts do
36
36
  terms.first['name'].should == 'Term 1'
37
37
  end
38
38
 
39
+ it "returns the roles for an account" do
40
+ stub_get(@client, "/api/v1/accounts/1/roles").to_return(json_response("account_roles.json"))
41
+ account = @client.account_roles(1)
42
+ roles = account.members
43
+ roles.count.should == 1
44
+ roles.first['id'].should == 1
45
+ roles.first['role'].should == 'AccountAdmin'
46
+ roles.first['permissions'].count.should == 4
47
+ roles.first['permissions']['manage_catalog']['enabled'].should == true
48
+ end
49
+
39
50
  end
@@ -0,0 +1,35 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "role": "AccountAdmin",
5
+ "label": "Account Admin",
6
+ "base_role_type": "AccountMembership",
7
+ "workflow_state": "built_in",
8
+ "permissions": {
9
+ "read_forum": {
10
+ "enabled": true,
11
+ "locked": false,
12
+ "readonly": false,
13
+ "explicit": false
14
+ },
15
+ "post_to_forum": {
16
+ "enabled": true,
17
+ "locked": false,
18
+ "readonly": false,
19
+ "explicit": false
20
+ },
21
+ "moderate_forum": {
22
+ "enabled": true,
23
+ "locked": false,
24
+ "readonly": false,
25
+ "explicit": false
26
+ },
27
+ "manage_catalog": {
28
+ "enabled": true,
29
+ "locked": false,
30
+ "readonly": false,
31
+ "explicit": false
32
+ }
33
+ }
34
+ }
35
+ ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bearcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.21
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills, Jake Sorce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -165,6 +165,7 @@ files:
165
165
  - spec/fixtures/account_reports_index.json
166
166
  - spec/fixtures/account_reports_result_success.json
167
167
  - spec/fixtures/account_reports_start_result.json
168
+ - spec/fixtures/account_roles.json
168
169
  - spec/fixtures/account_user.json
169
170
  - spec/fixtures/account_users.json
170
171
  - spec/fixtures/accounts.json
@@ -296,6 +297,7 @@ test_files:
296
297
  - spec/fixtures/account_reports_index.json
297
298
  - spec/fixtures/account_reports_result_success.json
298
299
  - spec/fixtures/account_reports_start_result.json
300
+ - spec/fixtures/account_roles.json
299
301
  - spec/fixtures/account_user.json
300
302
  - spec/fixtures/account_users.json
301
303
  - spec/fixtures/accounts.json