self.author_id = au.id
end
- def visible? au
- return false unless au
- self.own?(au) or self.publish?
- end
-
def own? au
- return false unless au
+ return false unless au.is_a?(Author)
self.author_id == au.id
end
+ def visible? au
+ if au == nil
+ return false if MagicNumber['run_mode'] == 1
+ elsif au.is_a?(Author)
+ return true if self.own?(au)
+ else
+ return false
+ end
+ self.publish?
+ end
+
def usable? au
visible? au
end
'[' + ary.map {|i| i.panel_elements_as_json }.join(',') + ']'
end
+ def licensed_pictures
+ r = {}
+ ((self.panel_pictures || []) + (self.ground_pictures || [])).compact.each do |elm|
+ r[elm.picture_id] = elm.picture unless r[elm.picture_id]
+ end
+ r
+ end
+
def self.visible_count
Panel.count
end
res
end
-=begin\r
+=begin
def self.validate_id ary, pid
ary.map {|v|
if pid