Class: Sanction::Blacklist::List

Inherits:
AttachedList
  • Object
show all
Defined in:
lib/sanction/blacklist/list.rb

Direct Known Subclasses

NullList

Instance Attribute Summary

Attributes inherited from AttachedList

#key, #parent

Instance Method Summary collapse

Methods inherited from AttachedList

#[], #has_scope?, #ids_blank?, #initialize, #resources, #type, #wildcard_member, #wildcard_resource?, #wildcarded?

Constructor Details

This class inherits a constructor from Sanction::AttachedList

Instance Method Details

#allowed_idsObject



5
6
7
# File 'lib/sanction/blacklist/list.rb', line 5

def allowed_ids
  []
end

#blacklist?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/sanction/blacklist/list.rb', line 16

def blacklist?
  true
end

#denied_idsObject



24
25
26
# File 'lib/sanction/blacklist/list.rb', line 24

def denied_ids
  entries.map {|x| x.id}
end

#null_node_classObject



28
29
30
# File 'lib/sanction/blacklist/list.rb', line 28

def null_node_class
  Sanction::Blacklist::NullNode
end

#permitted?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
# File 'lib/sanction/blacklist/list.rb', line 9

def permitted?
  return false if wildcard_resource?
  return false if resources.include?(@key)
  return true if ids_blank?
  true
end

#whitelist?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/sanction/blacklist/list.rb', line 20

def whitelist?
  false
end