Skip to content
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

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

Backport #10968 to v0.26

♥️ Thank you!

* 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 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
Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alecslupu alecslupu merged commit 1d28515 into release/0.26-stable Nov 6, 2023
48 checks passed
@alecslupu 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
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants