Method: JSS::Scopable::Scope#remove_limitation

Defined in:
lib/jss-api/api_object/scopable/scope.rb

#remove_limitation(key, item) ⇒ void

TODO:

handle ldap user/group lookups

This method returns an undefined value.

Remove a single item for limiting this scope.

Examples:

remove_limitation(:network_segments, "foo")

Parameters:

  • key (Symbol)

    the type of item being removed, :computer, :building, etc…

  • item (String)

    the name of the item being removed

Raises:



443
444
445
446
447
448
449
450
451
# File 'lib/jss-api/api_object/scopable/scope.rb', line 443

def remove_limitation( key, item)
  raise JSS::InvalidDataError, "Limitation key must be one of :#{LIMITATIONS.join(', :')}" unless LIMITATIONS.include? key
  raise JSS::InvalidDataError, "Item must be a #{key} name." unless item.kind_of? String

  return nil unless @limitations[key] and @limitations[key].include? item

  @limitations[key] -= [item]
  @container.should_update if @container
end