lib/jss/api_object/scopable/scope.rb
def add_limitation(key, item)
        key = pluralize_key(key)
        item_id = validate_item(:limitation, key, item)
        return nil if @limitations[key]&.include?(item_id)

        if @exclusions[key]&.include?(item_id)
          raise JSS::AlreadyExistsError, "Can't set #{key} limitation for '#{name}' because it's already an explicit exclusion."
        end

        @limitations[key] << item_id
        @container&.should_update
      end
# Add a single item for limiting this scope.
#
# The item name will be checked for existence in the JSS, and an exception raised if the item doesn't exist.
#
# @param key[Symbol] the type of item being added, :computer, :building, etc...
#
# @param item[String,integer] a valid identifier of the item being added
#
# @example
#   add_limitation(:network_segments, "foo")
#
# @return [void]
#
# @todo  handle ldap user/group lookups
#
Add a single item for limiting this scope.
The item name will be checked for existence in the JSS, and an exception raised if the item doesn't exist.
Add a single item for limiting this scope . The item name will be checked for existence in the JSS and an exception raised if the item doesn ' t exist .
def add_limitation(key, item)
        key = pluralize_key(key)
        item_id = validate_item(:limitation, key, item)
        return nil if @limitations[key]&.include?(item_id)
        if @exclusions[key]&.include?(item_id)
          raise JSS::AlreadyExistsError, "Can't set #{key} limitation for '#{name}' because it's already an explicit exclusion."
        end
        @limitations[key] << item_id
        @container&.should_update
      end
def add_limitation ( key , item ) key = pluralize_key ( key ) item_id = validate_item ( :limitation , key , item ) return nil if @limitations [ key ] &. include? ( item_id ) if @exclusions [ key ] &. include? ( item_id ) raise JSS :: AlreadyExistsError , "Can't set #{key} limitation for '#{name}' because it's already an explicit exclusion." end @limitations [ key ] << item_id @container &. should_update end
Add a single item for limiting this scope.
Add a single item for limiting this scope .
None
void
key
the type of item being added, :computer, :building, etc
the type of item being added : computer : building etc
item
a valid identifier of the item being added
a valid identifier of the item being added
example
None
todo
handle ldap user/group lookups
handle ldap user / group lookups