]> git.openstreetmap.org Git - rails.git/blobdiff - app/abilities/ability.rb
Use CanCanCan for redaction authorizations
[rails.git] / app / abilities / ability.rb
index f55f19e4ea7e2d918e81ee4a95f66990dea9b530..d7a10005764ba78011b2e68df59089575fc180fe 100644 (file)
@@ -8,6 +8,8 @@ class Ability
     can [:index, :rss, :show, :comments], DiaryEntry
     can [:search, :search_latlon, :search_ca_postcode, :search_osm_nominatim,
          :search_geonames, :search_osm_nominatim_reverse, :search_geonames_reverse], :geocoder
+    can [:index, :show], Redaction
+    can [:index, :show, :blocks_on, :blocks_by], UserBlock
 
     if user
       can :welcome, :site
@@ -18,6 +20,8 @@ class Ability
       if user.moderator?
         can [:index, :show, :resolve, :ignore, :reopen], Issue
         can :create, IssueComment
+        can [:new, :create, :edit, :update, :destroy], Redaction
+        can [:new, :edit, :create, :update, :revoke], UserBlock
       end
 
       if user.administrator?