]> git.openstreetmap.org Git - rails.git/blobdiff - app/abilities/api_ability.rb
Merge pull request #5677 from tomhughes/user-list-enhancements
[rails.git] / app / abilities / api_ability.rb
index a0340c5cd6fc30c7d0d25122bf8da9c3af379cdb..ec4de8f8e03b99dc795f88cecf6421aefb11c00e 100644 (file)
@@ -30,6 +30,8 @@ class ApiAbility
         can [:read, :update, :destroy], Message if scopes.include?("consume_messages")
         can :create, Message if scopes.include?("send_messages")
 
+        can :read, :active_user_blocks_list if scopes.include?("read_prefs")
+
         if user.terms_agreed?
           can [:create, :update, :upload, :close, :subscribe, :unsubscribe], Changeset if scopes.include?("write_map")
           can :create, ChangesetComment if scopes.include?("write_changeset_comments")
@@ -41,7 +43,9 @@ class ApiAbility
 
           can :destroy, Note if scopes.include?("write_notes")
 
-          can :redact, [OldNode, OldWay, OldRelation] if user&.terms_agreed? && scopes.include?("write_redactions")
+          can :redact, [OldNode, OldWay, OldRelation] if user.terms_agreed? && scopes.include?("write_redactions")
+
+          can :create, UserBlock if scopes.include?("write_blocks")
         end
       end
     end