Sha256: 5560a80fcd33ab0fb6da22eaeb16cf35f3651b95ebb4590cb213823b782dceb8
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
class IshManager::Ability include ::CanCan::Ability def initialize user # # signed in user # unless user.blank? # role manager if user.profile && user.profile.role_name == :manager can [ :create_newsitem, :show, :new_feature, :create_feature ], ::City can [ :new ], ::Feature can [ :cities_index, :home, :sites_index, :venues_index ], ::Manager can [ :new ], Newsitem can [ :new, :create ], Report can [ :show, :edit, :update, :create_newsitem, :new_feature, :create_feature ], ::Site do |site| !site.is_private && !site.is_trash end # can [ :new_feature, :create_feature ], ::Tag end if user.profile && user.profile.sudoer? can :manage, :all can [ :home ], ::Manager can :destroy, ::Photo end can [ :show ], ::Gallery do |gallery| gallery.user == user end end # # anonymous user # user ||= ::User.new can [ :show ], ::Gallery do |gallery| gallery.is_public end can [ :show ], ::Report do |report| report.is_public end end end
Version data entries
16 entries across 16 versions & 1 rubygems