Class: Killbill::Plugin::Api::SecurityApi
- Defined in:
- lib/killbill/gen/api/security_api.rb
Instance Method Summary collapse
- #add_role_definition(role, permissions, context) ⇒ Object
- #add_user_roles(username, clearPassword, roles, context) ⇒ Object
- #check_current_user_permissions(permissions, logical, context) ⇒ Object
- #get_current_user_permissions(context) ⇒ Object
- #get_role_definition(role, tenantContext) ⇒ Object
- #get_user_roles(username, tenantContext) ⇒ Object
-
#initialize(real_java_api) ⇒ SecurityApi
constructor
A new instance of SecurityApi.
- #invalidate_user(username, context) ⇒ Object
- #is_subject_authenticated ⇒ Object
- #login(principal, credentials) ⇒ Object
- #logout ⇒ Object
- #update_role_definition(role, permissions, context) ⇒ Object
- #update_user_password(username, clearPassword, context) ⇒ Object
- #update_user_roles(username, roles, context) ⇒ Object
Constructor Details
#initialize(real_java_api) ⇒ SecurityApi
Returns a new instance of SecurityApi.
37 38 39 |
# File 'lib/killbill/gen/api/security_api.rb', line 37 def initialize(real_java_api) @real_java_api = real_java_api end |
Instance Method Details
#add_role_definition(role, permissions, context) ⇒ Object
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/killbill/gen/api/security_api.rb', line 200 def add_role_definition(role, , context) # conversion for role [type = java.lang.String] role = role.to_s unless role.nil? # conversion for permissions [type = java.util.List] tmp = java.util.ArrayList.new ( || []).each do |m| # conversion for m [type = java.lang.String] m = m.to_s unless m.nil? tmp.add(m) end = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.add_role_definition(role, , context) end |
#add_user_roles(username, clearPassword, roles, context) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/killbill/gen/api/security_api.rb', line 109 def add_user_roles(username, clearPassword, roles, context) # conversion for username [type = java.lang.String] username = username.to_s unless username.nil? # conversion for clearPassword [type = java.lang.String] clearPassword = clearPassword.to_s unless clearPassword.nil? # conversion for roles [type = java.util.List] tmp = java.util.ArrayList.new (roles || []).each do |m| # conversion for m [type = java.lang.String] m = m.to_s unless m.nil? tmp.add(m) end roles = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.add_user_roles(username, clearPassword, roles, context) end |
#check_current_user_permissions(permissions, logical, context) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/killbill/gen/api/security_api.rb', line 89 def (, logical, context) # conversion for permissions [type = java.util.List] tmp = java.util.ArrayList.new ( || []).each do |m| # conversion for m [type = org.killbill.billing.security.Permission] m = Java::org.killbill.billing.security.Permission.value_of( m.to_s ) unless m.nil? tmp.add(m) end = tmp # conversion for logical [type = org.killbill.billing.security.Logical] logical = Java::org.killbill.billing.security.Logical.value_of( logical.to_s ) unless logical.nil? # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext] context = context.to_java unless context.nil? @real_java_api.(, logical, context) end |
#get_current_user_permissions(context) ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/killbill/gen/api/security_api.rb', line 72 def (context) # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext] context = context.to_java unless context.nil? res = @real_java_api.(context) # conversion for res [type = java.util.Set] tmp = [] (res || []).each do |m| # conversion for m [type = org.killbill.billing.security.Permission] m = m.to_s.to_sym unless m.nil? tmp << m end res = tmp return res end |
#get_role_definition(role, tenantContext) ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/killbill/gen/api/security_api.rb', line 240 def get_role_definition(role, tenantContext) # conversion for role [type = java.lang.String] role = role.to_s unless role.nil? # conversion for tenantContext [type = org.killbill.billing.util.callcontext.TenantContext] tenantContext = tenantContext.to_java unless tenantContext.nil? res = @real_java_api.get_role_definition(role, tenantContext) # conversion for res [type = java.util.List] tmp = [] (res || []).each do |m| # conversion for m [type = java.lang.String] tmp << m end res = tmp return res end |
#get_user_roles(username, tenantContext) ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/killbill/gen/api/security_api.rb', line 177 def get_user_roles(username, tenantContext) # conversion for username [type = java.lang.String] username = username.to_s unless username.nil? # conversion for tenantContext [type = org.killbill.billing.util.callcontext.TenantContext] tenantContext = tenantContext.to_java unless tenantContext.nil? begin res = @real_java_api.get_user_roles(username, tenantContext) # conversion for res [type = java.util.List] tmp = [] (res || []).each do |m| # conversion for m [type = java.lang.String] tmp << m end res = tmp return res rescue Java::org.killbill.billing.security.SecurityApiException => e raise Killbill::Plugin::Model::SecurityApiException.new.to_ruby(e) end end |
#invalidate_user(username, context) ⇒ Object
166 167 168 169 170 171 172 173 174 |
# File 'lib/killbill/gen/api/security_api.rb', line 166 def invalidate_user(username, context) # conversion for username [type = java.lang.String] username = username.to_s unless username.nil? # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.invalidate_user(username, context) end |
#is_subject_authenticated ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/killbill/gen/api/security_api.rb', line 59 def is_subject_authenticated() res = @real_java_api.is_subject_authenticated() # conversion for res [type = boolean] if res.nil? res = false else tmp_bool = (res.java_kind_of? java.lang.Boolean) ? res.boolean_value : res res = tmp_bool ? true : false end return res end |
#login(principal, credentials) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/killbill/gen/api/security_api.rb', line 43 def login(principal, credentials) # conversion for principal [type = java.lang.Object] principal = principal.to_s unless principal.nil? # conversion for credentials [type = java.lang.Object] credentials = credentials.to_s unless credentials.nil? @real_java_api.login(principal, credentials) end |
#logout ⇒ Object
54 55 56 |
# File 'lib/killbill/gen/api/security_api.rb', line 54 def logout() @real_java_api.logout() end |
#update_role_definition(role, permissions, context) ⇒ Object
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/killbill/gen/api/security_api.rb', line 220 def update_role_definition(role, , context) # conversion for role [type = java.lang.String] role = role.to_s unless role.nil? # conversion for permissions [type = java.util.List] tmp = java.util.ArrayList.new ( || []).each do |m| # conversion for m [type = java.lang.String] m = m.to_s unless m.nil? tmp.add(m) end = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.update_role_definition(role, , context) end |
#update_user_password(username, clearPassword, context) ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/killbill/gen/api/security_api.rb', line 132 def update_user_password(username, clearPassword, context) # conversion for username [type = java.lang.String] username = username.to_s unless username.nil? # conversion for clearPassword [type = java.lang.String] clearPassword = clearPassword.to_s unless clearPassword.nil? # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.update_user_password(username, clearPassword, context) end |
#update_user_roles(username, roles, context) ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/killbill/gen/api/security_api.rb', line 146 def update_user_roles(username, roles, context) # conversion for username [type = java.lang.String] username = username.to_s unless username.nil? # conversion for roles [type = java.util.List] tmp = java.util.ArrayList.new (roles || []).each do |m| # conversion for m [type = java.lang.String] m = m.to_s unless m.nil? tmp.add(m) end roles = tmp # conversion for context [type = org.killbill.billing.util.callcontext.CallContext] context = context.to_java unless context.nil? @real_java_api.update_user_roles(username, roles, context) end |