Full threadShirsenduK·Cancancan is one best tools to do this in Ruby. Maybe its DSL-like syntax will give you better ideas.https://github.com/CanCanCommunity/cancancanView on HN