debox 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -117,6 +117,25 @@ module Debox
117
117
  get_raw(path).body
118
118
  end
119
119
 
120
+
121
+ # acl
122
+ #----------------------------------------------------------------------
123
+
124
+ def self.acl_show(opt)
125
+ path = "/v1/acl/actions/#{opt[:app]}"
126
+ path += "/#{opt[:env]}" if opt[:env]
127
+ path += "?user=#{opt[:user]}" if opt[:user]
128
+ get(path)
129
+ end
130
+
131
+ def self.acl_add(opt)
132
+ path = "/v1/acl/actions/#{opt[:app]}"
133
+ path += "/#{opt[:env]}" if opt[:env]
134
+
135
+ post_raw path, user: opt[:user], action: opt[:action]
136
+ end
137
+
138
+
120
139
  private
121
140
 
122
141
  # HTTP helpers
@@ -0,0 +1,24 @@
1
+ require 'debox/command/base'
2
+
3
+ class Debox::Command::Acl < Debox::Command::Base
4
+ include Debox::Utils
5
+
6
+ help :show, params: ['application', 'environment', 'user'], text: 'Show acl for the given user'
7
+ def show
8
+ app = args[0]
9
+ env = args[1]
10
+ user = args[2]
11
+ puts Debox::API.acl_show app: app, env: env, user: user
12
+ end
13
+
14
+ help :add, params: ['application', 'environment', 'user', 'action'], text: 'Add acl for the given user'
15
+ def add
16
+ app = args[0]
17
+ env = args[1]
18
+ user = args[2]
19
+ action = args[3]
20
+ puts Debox::API.acl_add app: app, env: env, user: user, action: action
21
+ end
22
+
23
+
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Debox
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-17 00:00:00.000000000 Z
12
+ date: 2014-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -112,6 +112,7 @@ files:
112
112
  - lib/debox/api.rb
113
113
  - lib/debox/cli.rb
114
114
  - lib/debox/command.rb
115
+ - lib/debox/command/acl.rb
115
116
  - lib/debox/command/apps.rb
116
117
  - lib/debox/command/auth.rb
117
118
  - lib/debox/command/base.rb
@@ -167,12 +168,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
168
  - - ! '>='
168
169
  - !ruby/object:Gem::Version
169
170
  version: '0'
171
+ segments:
172
+ - 0
173
+ hash: -1616391648425404926
170
174
  required_rubygems_version: !ruby/object:Gem::Requirement
171
175
  none: false
172
176
  requirements:
173
177
  - - ! '>='
174
178
  - !ruby/object:Gem::Version
175
179
  version: '0'
180
+ segments:
181
+ - 0
182
+ hash: -1616391648425404926
176
183
  requirements: []
177
184
  rubyforge_project:
178
185
  rubygems_version: 1.8.23
@@ -208,4 +215,3 @@ test_files:
208
215
  - spec/integration/commands/recipes/show_spec.rb
209
216
  - spec/spec_helper.rb
210
217
  - spec/support/herlpers.rb
211
- has_rdoc: