Class: Kaltura::Service::AdminUserService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/kaltura/service/admin_user_service.rb

Overview

AdminUserService manages details for the administrative KMC user.

Examples:

Setting a new Admin password:

client.admin_user_service.update_password('[email protected]','OMGWTFPASSWRD',,'PASSWRDBBQ')

Setting a new Admin password/email:

client.admin_user_service.update_password('[email protected]','OMGWTFPASSWRD','[email protected]','PASSWRDBBQ')

Resetting a admins password:

client.admin_user_service.reset_password('[email protected]')

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #perform_request

Constructor Details

This class inherits a constructor from Kaltura::Service::BaseService

Instance Method Details

#login(email, password) ⇒ String

Gets an admin session using the admin email and password. This method is used for the KMC login.

Parameters:

  • email (String)

    The admin’s email address.

  • password (String)

    The admin’s password.

Returns:

  • (String)

    User session string.

Raises:

  • (Kaltura::APIError)

    raises default Kaltura errors in addition to ADMIN_KUSER_NOT_FOUND if the user isn’t found.



61
62
63
64
65
66
# File 'lib/kaltura/service/admin_user_service.rb', line 61

def (email, password)
	kparams = {}
	client.add_param(kparams, 'email', email)
	client.add_param(kparams, 'password', password)
	perform_request('adminUser','login',kparams,false)
end

#reset_password(email) ⇒ nil

Resets admins user password and sends the new one to the admins’ email address.

Parameters:

  • email (String)

    The admin’s email address.

Returns:

  • (nil)

    returns nil.

Raises:



45
46
47
48
49
# File 'lib/kaltura/service/admin_user_service.rb', line 45

def reset_password(email)
	kparams = {}
	client.add_param(kparams, 'email', email)
	perform_request('adminUser','resetPassword',kparams,false)
end

#update_password(email, password, new_email = '', new_password = '') ⇒ Kaltura::AdminUser

Updates the admin password and email.

Parameters:

  • email (String)

    Administrative user email.

  • password (String)

    Current administrative user password.

  • new_email (String) (defaults to: '')

Returns:

Raises:

  • (Kaltura::APIError)

    Returns two additional error messages: INVALID_FIELD_VALUE when a field isn’t valid and ADMIN_KUSER_WRONG_OLD_PASSWORD when the old password is wrong.



27
28
29
30
31
32
33
34
# File 'lib/kaltura/service/admin_user_service.rb', line 27

def update_password(email, password, new_email='', new_password='')
	kparams = {}
	client.add_param(kparams, 'email', email)
	client.add_param(kparams, 'password', password)
	client.add_param(kparams, 'newEmail', new_email)
	client.add_param(kparams, 'newPassword', new_password)
	perform_request('adminUser','updatePassword',kparams,false)
end