Sha256: dee60ecae60d0a267a51e1349efd005366db35c04148ce2b65d54af6286d401d
Contents?: true
Size: 572 Bytes
Versions: 8
Compression:
Stored size: 572 Bytes
Contents
class IshManager::Ability include ::CanCan::Ability def initialize user # # signed in user # unless user.blank? if user.profile && user.profile.manager? can :manage, :all can [ :home ], ::Manager can :destroy, ::Photo end can [ :show ], ::Gallery do |gallery| gallery.user == user end end user ||= ::User.new can [ :read ], ::Gallery do |gallery| gallery.is_public end can [ :read ], ::Report do |report| report.is_public end end end
Version data entries
8 entries across 8 versions & 1 rubygems