fix album posting
This commit is contained in:
parent
ae7c869bc3
commit
004e659ee1
1 changed files with 6 additions and 2 deletions
|
|
@ -128,14 +128,18 @@ class User
|
|||
end
|
||||
|
||||
def validate_aspect_permissions(aspect_ids)
|
||||
aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId
|
||||
if aspect_ids == "all"
|
||||
return aspect_ids
|
||||
end
|
||||
|
||||
aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array
|
||||
|
||||
if aspect_ids.nil? || aspect_ids.empty?
|
||||
raise ArgumentError.new("You must post to someone.")
|
||||
end
|
||||
|
||||
aspect_ids.each do |aspect_id|
|
||||
unless aspect_id == "all" || self.aspects.find(aspect_id)
|
||||
unless self.aspects.find(aspect_id)
|
||||
raise ArgumentError.new("Cannot post to an aspect you do not own.")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue