OpenSourcePolitics / decidim

Fork of Decidim
http://www.decidim.org
GNU Affero General Public License v3.0
20 stars 4 forks source link

Button "Modifier la proposition" appears when it shoudn't #241

Closed virgile-dev closed 6 years ago

virgile-dev commented 6 years ago

Describe the bug User can modify proposals that they didn't author. The delay for proposal modification doesn't seem to matter.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://club.decidim.opensourcepolitics.eu/processes/new-components/f/95/proposals/193 a proposition made by Valentin.
  2. Login as mako
  3. You can see that the button "Modifier la proposition" appears
  4. If I click I can access the form but fortunately I can't hit "Envoyer".
  5. If I hit send the application displays this error "Des erreurs se sont produites lors de l'enregistrement de la proposition."

Expected behavior The button "Modifier la proposition" should only appear on the proposals I authored and when the timeframe for proposal modification set on the feature configuration hasn't ellapsed.

Screenshots

capture d ecran 2018-09-06 a 12 49 12

Extra data (please complete the following information):

armandfardeau commented 6 years ago

Seems to not be present on 0.12-stable developement_app : image

moustachu commented 6 years ago

it seems that it comes from this hazardous fix of mine https://github.com/OpenSourcePolitics/decidim/commit/4931a49d14b585f0d90677153202a10be668cf24

which unexpectedly resolved this issue https://github.com/OpenSourcePolitics/decidim/issues/136

The magic 💀 debug print was removed later in our 0.12-stable (0.12.2) so it explains why we don't reproduce it in the latest version.

For the other platform that cannot be update soon, we can patch this with on overrides on the corresponding osp-app by adding this file

https://github.com/OpenSourcePolitics/decidim/blob/0.12-stable/decidim-core/app/controllers/concerns/decidim/needs_permission.rb

to the app

--> ./app/controllers/concerns/decidim/needs_permission.rb


Platform to be fixed :


moustachu commented 6 years ago

Closing for now. ⏲

It should be reopened if we find other affected platform.