Class: Kaltura::Service::AccessControlService

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

Overview

AccessControlService is responsible for adding and managing access control profiles.

Examples:

Add a new access control profile:

access_control = Kaltura::AccessControl.new
access_control.name = "Restrictions"
client.access_control_service.add(access_control)

Retrive an access control profile:

client.access_control_service.get(5)

Update an existing access control profile:

new_access_control = Kaltura::AccessControl.new
new_access_control.description = "making the world safer one profile at a time."
client.access_control_service.update(5,new_access_control)

Delete an eisting access control profile:

client.access_control_service.delete(5)

List up to 10 Access Control Profiles ordered by name:

filter = Kaltura::Filter::AccessControlFilter.new
filter.order_by('name')
pager = Kaltura::FilterPager.new
pager.page_size = 10
client.access_control_service.list(filter,pager)

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

#add(access_control) ⇒ Kaltura::AccessControl

Adds a new Access Control Profile.

Parameters:

Returns:

  • (Kaltura::AccessControl)

    Returns the AccessControl object if the action was successful. Useful for knowing the id of the object.

Raises:



40
41
42
43
44
# File 'lib/kaltura/service/access_control_service.rb', line 40

def add(access_control)
	kparams = {}
	client.add_param(kparams, 'accessControl', access_control)
	perform_request('accessControl','add',kparams,false)
end

#delete(id) ⇒ nil

Deletes an Access Control Profile by ID.

Parameters:

  • id (Integer)

    The Access Control Profile ID.

Returns:

  • (nil)

    returns nothing

Raises:



88
89
90
91
92
# File 'lib/kaltura/service/access_control_service.rb', line 88

def delete(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	perform_request('accessControl','delete',kparams,false)
end

#get(id) ⇒ Kaltura::AccessControl

Retrieves an Access Control Profile by ID.

Parameters:

  • id (Integer)

    The Access Control Profile ID.

Returns:

Raises:



55
56
57
58
59
# File 'lib/kaltura/service/access_control_service.rb', line 55

def get(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	perform_request('accessControl','get',kparams,false)
end

#list(filter = nil, pager = nil) ⇒ Kaltura::Response::AccessControlListResponse

Lists Access Control Profiles given an optional filter and pager.

Parameters:

Returns:



102
103
104
105
106
107
# File 'lib/kaltura/service/access_control_service.rb', line 102

def list(filter=nil, pager=nil)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'pager', pager)
	perform_request('accessControl','list',kparams,false)
end

#update(id, access_control) ⇒ Kaltura:AccessControl

Updates an Access Control Profile by ID. Like other API update service calls, you instantiate a new AccessControl object, perform your changes to the new object, and use that as the second parameter. There are no required parameters.

Parameters:

  • id (Integer)

    The Access Control Profile ID.

  • access_control (Kaltura::AccessControl)

    A newly instantiated AccessControl object that has the only the attributes you want to edit.

Returns:

  • (Kaltura:AccessControl)

    Returns the updated Access Control profile if the action was successful.

Raises:



72
73
74
75
76
77
# File 'lib/kaltura/service/access_control_service.rb', line 72

def update(id, access_control)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.add_param(kparams, 'accessControl', access_control)
	perform_request('accessControl','update',kparams,false)
end