kaui 0.14.1 → 0.14.2

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: 373e8cbf4148b25bba71c10080a5e770768424e1
4
- data.tar.gz: 892d69a11441a55f70981c6a95cd9e759e74a9e6
3
+ metadata.gz: 0a9ec1ec7ef252ca12a43f8149f34b8d05f9380e
4
+ data.tar.gz: 74b4b0292efc15111d1c199572a38dc8d47db671
5
5
  SHA512:
6
- metadata.gz: dc5dcb3a79055588ca5e1e551cd263496501dc6f8a4787a11210131603c409f124b84d629b4097a601d7405e6a911f617eaa509a8e74893f7f6c51ed94b9e214
7
- data.tar.gz: 3cb084a400d0d95c01cc0c1609cb5d1674f144b7c7d9492df52f44d485b1a65d03dfb61087c3e22b9635cd00c35e85e9b8109a2089b959a72c996e3b48811ead
6
+ metadata.gz: 4d1c6e1c3c01e6e17fa8b124a6211edfb95cd3104770b1f2abaa93a661e96334263564ea5b5bdaa9c450912182daba58efe24915b606d42ac090addaa23055cf
7
+ data.tar.gz: 5bb0eb6ca5e539d3c8debd3fbca23817d028ae14438e3f7ded0f770d2e73709b2ae59c1ace08db7e3fbde6cc15bb24a1086a55de0d8c3ebb4fc0245b14f84d11
@@ -71,7 +71,7 @@ class Kaui::AdminTenantsController < Kaui::EngineController
71
71
 
72
72
  def show
73
73
  @tenant = safely_find_tenant_by_id(params[:id])
74
- @allowed_users = retrieve_allowed_users_for_current_user
74
+ @allowed_users = @tenant.kaui_allowed_users & retrieve_allowed_users_for_current_user
75
75
  end
76
76
 
77
77
  def upload_catalog
@@ -171,7 +171,13 @@ class Kaui::AdminTenantsController < Kaui::EngineController
171
171
 
172
172
  def remove_allowed_user
173
173
  current_tenant = safely_find_tenant_by_id(params[:id])
174
- au = Kaui::AllowedUser.find(params[:allowed_user][:id])
174
+ au = Kaui::AllowedUser.find(params.require(:allowed_user).require(:id))
175
+
176
+ if Kaui.root_username != current_user.kb_username
177
+ render :json => {:alert => 'Only the root user can remove users from tenants'}.to_json, :status => 401
178
+ return
179
+ end
180
+
175
181
  # remove the association
176
182
  au.kaui_tenants.delete current_tenant
177
183
  render :json => '{}', :status => 200
@@ -30,9 +30,11 @@
30
30
  <td><%= link_to u.kb_username, admin_allowed_user_path(u.id) %></td>
31
31
  <td><%= u.description %></td>
32
32
  <td>
33
- <button type="button" class="btn btn-default btn-sm" id="<%= "allowed-user-remove-#{u.id}" %>">
34
- <span class="fa fa-times"></span>
35
- </button>
33
+ <% if Kaui.root_username == current_user.kb_username %>
34
+ <button type="button" class="btn btn-default btn-sm" id="<%= "allowed-user-remove-#{u.id}" %>">
35
+ <span class="fa fa-times"></span>
36
+ </button>
37
+ <% end %>
36
38
  </td>
37
39
  </tr>
38
40
  <% end %>
data/lib/kaui/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = '0.14.1'
2
+ VERSION = '0.14.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-07 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails