Sha256: e95eae78d7d7c7a9ec62c5e8282aa02c9f7ff54f69a2553ff4eb919e93869399
Contents?: true
Size: 630 Bytes
Versions: 4
Compression:
Stored size: 630 Bytes
Contents
class Ishapi::Ability include ::CanCan::Ability def initialize user # # signed in user # unless user.blank? if user.profile && user.profile.manager? 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 [ :show ], Report do |report| report.is_public end can [ :welcome_home ], Ishapi can [ :index, :show ], Site end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ishapi-0.1.8.10 | app/models/ishapi/ability.rb |
ishapi-0.1.8.9 | app/models/ishapi/ability.rb |
ishapi-0.1.8.8 | app/models/ishapi/ability.rb |
ishapi-0.1.8.7 | app/models/ishapi/ability.rb |