Skip to content

Instantly share code, notes, and snippets.

@gaspard
Created February 2, 2009 20:36
Show Gist options
  • Save gaspard/57086 to your computer and use it in GitHub Desktop.
Save gaspard/57086 to your computer and use it in GitHub Desktop.
# site_id AND... OWNER
scope = "nodes.site_id = #{visitor.site.id} AND (nodes.user_id = '#{visitor[:id]}' OR "+
# OR READER if published
"(nodes.rgroup_id IN (#{visitor.group_ids.join(',')}) AND nodes.publish_from <= now() ) OR " +
# OR publisher if status is <> red
"(nodes.pgroup_id IN (#{visitor.group_ids.join(',')}) AND nodes.max_status <> #{Zena::Status[:red]}))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment