+# frozen_string_literal: true
+
class Ability
include CanCan::Ability
def initialize(user)
can :index, :site
+ can [:permalink, :edit, :help, :fixthemap, :offline, :export, :about, :preview, :copyright, :key, :id, :welcome], :site
+
+ can [:list, :rss, :view, :comments], DiaryEntry
+
+ can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
+ :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder
if user
- can :welcome, :site
+ can :weclome, :site
+
+ can [:create, :edit, :comment, :subscribe, :unsubscribe], DiaryEntry
+
+ can [:hide, :hidecomment], [DiaryEntry, DiaryComment] if user.administrator?
end
# Define abilities for the passed in user here. For example:
#