-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport 'Redirect non-admin users to core's root_path' to v0.26 #11936
Merged
alecslupu
merged 5 commits into
release/0.26-stable
from
backport/0.26/redirect-non-admin-users-to-co-10968
Nov 6, 2023
Merged
Backport 'Redirect non-admin users to core's root_path' to v0.26 #11936
alecslupu
merged 5 commits into
release/0.26-stable
from
backport/0.26/redirect-non-admin-users-to-co-10968
Nov 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Redirect non-admin users to core's root_path * Add spec * Remove redirection of non-admin users to core's root_path * Prevent redirection to TOS page if the user isn't allowed * Check that we're not leaking routes information on redirections * Extract method to check if a user is a moderator in a ParticipatorySpace * Check if the user has any role in the TOS acceptance logic * Remove unecessary return from method * Test for correct accesses of the spaces' admins pages Done for: * decidim-assemblies * decidim-conferences * decidim-participatory_spaces As they are mostly the same related in the permissions logics: there are participatory space admins and valuators. Others modules (such as decidim-initiatives and decidim-elections with the Votings spaces) don not have these roles. * Test for correct access of the decidim-initiatives module * Fix bug when there isn't any published conference We were redirecting (status code 30x) to a 404 page. What you need to do is to actually present a status code 404 (as that's the HTTP status code for a NotFound document) This was detected with the last specs changes :) * Check if the user is a votings' monitoring commitee member in the TOS acceptance * Check if the user is has a participatory space role in the TOS acceptance Done for: * decidim-assemblies * decidim-conferences * decidim-participatory_spaces * Test for correct accesses of the spaces' admins pages (part II) Add valuator role * Add spec for decidim-verifications admin route * Move routes definitions for decidim-templates to decidim-admin If we don't do this, it's not respecting the decidim-admin constraints that are already defined. This was detected with a redirect when there was a normal user. Instead of giving a 404 in /admin/templates/questionnaire_templates, it was giving a redirection (301) to /admin. Moving the definition of the routes to the decidim-admin module honors all the contracts from the admin. * Fix routes generation for decidim-templates move * Remove unecessary comment * Prefer usage of instead of Suggested by code review Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro> * Use method Suggested by code review Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro> * Require the examples only on the needed files * Rename shared example to 'accessing the participatory space' * Remove unecessary shared example for ParticipatoryProcesses * Fix typo when checking if module exists * Prefer usage of instead of Suggested by code review --------- Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
andreslucena
added
backport
Pull Requests that are a backport for a fixed bug
module: admin
type: fix
PRs that implement a fix for a bug
labels
Nov 3, 2023
alecslupu
approved these changes
Nov 6, 2023
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.
👍
alecslupu
deleted the
backport/0.26/redirect-non-admin-users-to-co-10968
branch
November 6, 2023 11:14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport
Pull Requests that are a backport for a fixed bug
module: admin
type: fix
PRs that implement a fix for a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
Backport #10968 to v0.26