Sha256: b700ae11c0a61d12fe9a3d0a82955a63e9e1faffcc1306e402592b5b1cb9eae0
Contents?: true
Size: 790 Bytes
Versions: 9
Compression:
Stored size: 790 Bytes
Contents
class Ishapi::Ability include ::CanCan::Ability def initialize user # # signed in user # unless user.blank? if user.profile && user.profile.sudoer? can :manage, :all end can [ :show ], Gallery do |gallery| gallery.user == user end end # # anonymous user # user ||= User.new can [ :index, :show ], City can [ :show ], Gallery do |gallery| gallery.is_public end can [ :index ], Report can [ :my_index, :show ], Report do |report| report.is_public end can [ :welcome_home, :fb_sign_in, :open_permission ], Ishapi can [ :index, :show ], Site can [ :index ], Venue can [ :show ], Venue do |venue| venue.is_public end end end
Version data entries
9 entries across 9 versions & 1 rubygems