+
+ if token&.user&.terms_agreed? || !REQUIRE_TERMS_AGREED
+ can :create, ChangesetComment if capability?(token, :allow_write_api)
+ end
+
+ if token&.user&.moderator?
+ can [:destroy, :restore], ChangesetComment if capability?(token, :allow_write_api)
+ can :destroy, Note if capability?(token, :allow_write_notes)
+ end