Class: Sanction::Whitelist::List
Instance Attribute Summary
Attributes inherited from AttachedList
#key, #parent
Instance Method Summary
collapse
#[], #has_scope?, #ids_blank?, #initialize, #resources, #type, #wildcard_member, #wildcard_resource?, #wildcarded?
Instance Method Details
#allowed_ids ⇒ Object
5
6
7
|
# File 'lib/sanction/whitelist/list.rb', line 5
def allowed_ids
(wildcard_resource? || resources.include?(@key)) ? entries.map {|x| x.id} : []
end
|
#blacklist? ⇒ Boolean
16
17
18
|
# File 'lib/sanction/whitelist/list.rb', line 16
def blacklist?
false
end
|
#denied_ids ⇒ Object
24
25
26
|
# File 'lib/sanction/whitelist/list.rb', line 24
def denied_ids
[]
end
|
#null_node_class ⇒ Object
#permitted? ⇒ Boolean
9
10
11
12
13
14
|
# File 'lib/sanction/whitelist/list.rb', line 9
def permitted?
return true if wildcard_resource?
return false if ids_blank?
return true if resources.include?(@key)
false
end
|
#whitelist? ⇒ Boolean
20
21
22
|
# File 'lib/sanction/whitelist/list.rb', line 20
def whitelist?
true
end
|