-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade to decidim 0.15 #19
Upgrade to decidim 0.15 #19
Conversation
To confom with the Decidim privacy policy the uploaded document ids are now encrypted.
… of "Municipality Census".
|
Hi @xredo , Thanks! 😄 |
|
HI @tramuntanal, I'm Juan from MarsBased. I'm doing this PR review but I have problems testing this branch. After run: bin/rails decidim:generate_external_test_app
rspecI have these errors: This doesn't happen in the master branch. Looks like as in that Decidim version the gem's migrations don't charge in the dummy app Do you have the same problem? |
|
Yes, its seems that the migration is not automatically copied into the dummy app. We had to manually copy the file: I'll bring this issue to Decidim's main project |
|
Ok, thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tramuntanal
We have reviewed the code and most of the changes are great. It's nice to have the plugin more configurable and some bugs solved (apart from the upgrade). I would like to apology again in the name of MarsBased for not having performed the reviews before.
We have noticed what it seems to be a bug in the code and we have some doubts that we would like to solve with you before accepting the Pull Request.
Could you please take a look at the comments? Thank you!
| return permission_action if permission_action.scope != :admin | ||
| return Decidim::Proposals::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin | ||
| if user.organization.available_authorizations.include?("file_authorization_handler") | ||
| if permission_action_in(:manage, :read) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this be permission_action_in??
| module FileAuthorizationHandler | ||
| class AdminEngine < ::Rails::Engine | ||
| isolate_namespace Decidim::FileAuthorizationHandler::Admin | ||
| paths["db/migrate"] = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it required to remove the migrate path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was causing apps to crash, I don't remember the exact situation. By the way, what does it mean to set paths["db/migrate"]= nil to not load migrations at runtime?
app/permissions/decidim/file_authorizations_handler/admin/permissions.rb
Show resolved
Hide resolved
| class Permissions < Decidim::DefaultPermissions | ||
| def permissions | ||
| return permission_action if permission_action.scope != :admin | ||
| return Decidim::Proposals::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the Proposal permissions here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the lines 12 to 16 never run, because if permission_action.scope != :admin returns line 10 and if not returns line 11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebuilt it.
| module FileAuthorizationHandler | ||
| module Admin | ||
| # Defines the abilities related to surveys for a logged in admin user. | ||
| # Intended to be used with `cancancan`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We to remove this comment
| class Permissions < Decidim::DefaultPermissions | ||
| def permissions | ||
| return permission_action unless user | ||
| return Decidim::FileAuthorizationHandler::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I am missing something, but I don't see why we need to check for the Admin permissions in here. Could you explain the use case? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this file as there is no one is using it.
|
Hi @artero sorry I lost notifications and didn't know you made the review. |
…dim-file_authorization_handler into upgrade/decidim-0.15
…t clear why it is being setted.
23ea1a3 to
90eb240
Compare
90eb240 to
ebc4388
Compare
|
Hi @artero the PR has been updated as requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge, Thankyou very much!
No description provided.