Class: Kaltura::KalturaUserService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaUserService
- Defined in:
- lib/kaltura_client.rb
Overview
Manage partner users on Kaltura’s side
The userId in kaltura is the unique Id in the partner's system, and the [partnerId,Id] couple are unique key in kaltura's DB
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(user) ⇒ Object
Adds a new user to an existing account in the Kaltura database.
- #add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_user_data = KalturaNotImplemented) ⇒ Object
-
#check_login_data_exists(filter) ⇒ Object
Action which checks whther user login.
-
#delete(user_id) ⇒ Object
Deletes a user from a partner account.
-
#disable_login(user_id = KalturaNotImplemented, login_id = KalturaNotImplemented) ⇒ Object
Disables a user’s ability to log into a partner account using an email address and a password.
-
#enable_login(user_id, login_id, password = KalturaNotImplemented) ⇒ Object
Enables a user to log into a partner account using an email address and a password.
-
#get(user_id = KalturaNotImplemented) ⇒ Object
Retrieves a user object for a specified user ID.
-
#get_by_login_id(login_id) ⇒ Object
Retrieves a user object for a user’s login ID and partner ID.
-
#index(id, should_update = true) ⇒ Object
Index an entry by id.
-
#initialize(client) ⇒ KalturaUserService
constructor
A new instance of KalturaUserService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
Lists user objects that are associated with an account.
-
#login(partner_id, user_id, password, expiry = 86400, privileges = '*') ⇒ Object
Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password.
-
#login_by_login_id(login_id, password, partner_id = KalturaNotImplemented, expiry = 86400, privileges = '*') ⇒ Object
Logs a user into a partner account with a user login ID and a user password.
-
#notify_ban(user_id) ⇒ Object
Notifies that a user is banned from an account.
-
#reset_password(email) ⇒ Object
Reset user’s password and send the user an email to generate a new one.
-
#set_initial_password(hash_key, new_password) ⇒ Object
Set initial users password.
-
#update(user_id, user) ⇒ Object
Updates an existing user object.
-
#update_login_data(old_login_id, password, new_login_id = '', new_password = '', new_first_name = KalturaNotImplemented, new_last_name = KalturaNotImplemented) ⇒ Object
Updates a user’s login data: email, password, name.
Constructor Details
#initialize(client) ⇒ KalturaUserService
Returns a new instance of KalturaUserService.
5203 5204 5205 |
# File 'lib/kaltura_client.rb', line 5203 def initialize(client) super(client) end |
Instance Method Details
#add(user) ⇒ Object
Adds a new user to an existing account in the Kaltura database. Input param $id is the unique identifier in the partner’s system.
5210 5211 5212 5213 5214 5215 5216 5217 5218 |
# File 'lib/kaltura_client.rb', line 5210 def add(user) kparams = {} client.add_param(kparams, 'user', user) client.queue_service_action_call('user', 'add', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_user_data = KalturaNotImplemented) ⇒ Object
5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 |
# File 'lib/kaltura_client.rb', line 5413 def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_user_data=KalturaNotImplemented) kparams = {} kfiles = {} client.add_param(kfiles, 'fileData', file_data) client.add_param(kparams, 'bulkUploadData', bulk_upload_data) client.add_param(kparams, 'bulkUploadUserData', bulk_upload_user_data) client.queue_service_action_call('user', 'addFromBulkUpload', 'KalturaBulkUpload', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |
#check_login_data_exists(filter) ⇒ Object
Action which checks whther user login
5428 5429 5430 5431 5432 5433 5434 5435 5436 |
# File 'lib/kaltura_client.rb', line 5428 def check_login_data_exists(filter) kparams = {} client.add_param(kparams, 'filter', filter) client.queue_service_action_call('user', 'checkLoginDataExists', 'bool', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(user_id) ⇒ Object
Deletes a user from a partner account.
5261 5262 5263 5264 5265 5266 5267 5268 5269 |
# File 'lib/kaltura_client.rb', line 5261 def delete(user_id) kparams = {} client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('user', 'delete', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#disable_login(user_id = KalturaNotImplemented, login_id = KalturaNotImplemented) ⇒ Object
Disables a user’s ability to log into a partner account using an email address and a password. You may use either a userId or a loginId parameter for this action.
5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 |
# File 'lib/kaltura_client.rb', line 5389 def disable_login(user_id=KalturaNotImplemented, login_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'loginId', login_id) client.queue_service_action_call('user', 'disableLogin', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#enable_login(user_id, login_id, password = KalturaNotImplemented) ⇒ Object
Enables a user to log into a partner account using an email address and a password
5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 |
# File 'lib/kaltura_client.rb', line 5374 def enable_login(user_id, login_id, password=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'loginId', login_id) client.add_param(kparams, 'password', password) client.queue_service_action_call('user', 'enableLogin', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get(user_id = KalturaNotImplemented) ⇒ Object
Retrieves a user object for a specified user ID.
5236 5237 5238 5239 5240 5241 5242 5243 5244 |
# File 'lib/kaltura_client.rb', line 5236 def get(user_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('user', 'get', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get_by_login_id(login_id) ⇒ Object
Retrieves a user object for a user’s login ID and partner ID. A login ID is the email address used by a user to log into the system.
5249 5250 5251 5252 5253 5254 5255 5256 5257 |
# File 'lib/kaltura_client.rb', line 5249 def get_by_login_id(login_id) kparams = {} client.add_param(kparams, 'loginId', login_id) client.queue_service_action_call('user', 'getByLoginId', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#index(id, should_update = true) ⇒ Object
Index an entry by id.
5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 |
# File 'lib/kaltura_client.rb', line 5402 def index(id, should_update=true) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'shouldUpdate', should_update) client.queue_service_action_call('user', 'index', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
Lists user objects that are associated with an account. Blocked users are listed unless you use a filter to exclude them. Deleted users are not listed unless you use a filter to include them.
5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 |
# File 'lib/kaltura_client.rb', line 5275 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('user', 'list', 'KalturaUserListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#login(partner_id, user_id, password, expiry = 86400, privileges = '*') ⇒ Object
Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password.
5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 |
# File 'lib/kaltura_client.rb', line 5300 def login(partner_id, user_id, password, expiry=86400, privileges='*') kparams = {} client.add_param(kparams, 'partnerId', partner_id) client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'expiry', expiry) client.add_param(kparams, 'privileges', privileges) client.queue_service_action_call('user', 'login', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#login_by_login_id(login_id, password, partner_id = KalturaNotImplemented, expiry = 86400, privileges = '*') ⇒ Object
Logs a user into a partner account with a user login ID and a user password.
5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 |
# File 'lib/kaltura_client.rb', line 5316 def login_by_login_id(login_id, password, partner_id=KalturaNotImplemented, expiry=86400, privileges='*') kparams = {} client.add_param(kparams, 'loginId', login_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'partnerId', partner_id) client.add_param(kparams, 'expiry', expiry) client.add_param(kparams, 'privileges', privileges) client.queue_service_action_call('user', 'loginByLoginId', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#notify_ban(user_id) ⇒ Object
Notifies that a user is banned from an account.
5288 5289 5290 5291 5292 5293 5294 5295 5296 |
# File 'lib/kaltura_client.rb', line 5288 def notify_ban(user_id) kparams = {} client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('user', 'notifyBan', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#reset_password(email) ⇒ Object
Reset user’s password and send the user an email to generate a new one.
5349 5350 5351 5352 5353 5354 5355 5356 5357 |
# File 'lib/kaltura_client.rb', line 5349 def reset_password(email) kparams = {} client.add_param(kparams, 'email', email) client.queue_service_action_call('user', 'resetPassword', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#set_initial_password(hash_key, new_password) ⇒ Object
Set initial users password
5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 |
# File 'lib/kaltura_client.rb', line 5361 def set_initial_password(hash_key, new_password) kparams = {} client.add_param(kparams, 'hashKey', hash_key) client.add_param(kparams, 'newPassword', new_password) client.queue_service_action_call('user', 'setInitialPassword', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update(user_id, user) ⇒ Object
Updates an existing user object. You can also use this action to update the userId.
5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 |
# File 'lib/kaltura_client.rb', line 5223 def update(user_id, user) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'user', user) client.queue_service_action_call('user', 'update', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update_login_data(old_login_id, password, new_login_id = '', new_password = '', new_first_name = KalturaNotImplemented, new_last_name = KalturaNotImplemented) ⇒ Object
Updates a user’s login data: email, password, name.
5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 |
# File 'lib/kaltura_client.rb', line 5332 def update_login_data(old_login_id, password, new_login_id='', new_password='', new_first_name=KalturaNotImplemented, new_last_name=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'oldLoginId', old_login_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'newLoginId', new_login_id) client.add_param(kparams, 'newPassword', new_password) client.add_param(kparams, 'newFirstName', new_first_name) client.add_param(kparams, 'newLastName', new_last_name) client.queue_service_action_call('user', 'updateLoginData', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |