Commit graph

16 commits

Author SHA1 Message Date
GitLab Bot
71c6369c63 Add latest changes from gitlab-org/gitlab@master 2019-10-26 06:06:35 +00:00
GitLab Bot
b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
James Edwards-Jones
bedb9a3e6d Avoid passing not_found_or_authorized_proc around
Since this needs to be called on every find_routable!(Project, ...
we can instead move it to a RoutableActions check.
2019-05-15 17:36:50 +07:00
James Edwards-Jones
224c01033f Refactor RoutableActions to allow for additional checks 2019-05-15 11:54:30 +07:00
Thong Kuah
28dabc67f4 Restore 403 functionality for external auth (EE)
When we unhooked ClustersController from
Project::ApplicationsController, we missed an EE override to
handle_not_found_or_authorized.

Rather than carry on with override RoutingActions, make a specific proc
for Project that we override in EE instead. Use that proc in both
Clusters::BaseController and Project::ApplicationsController.
2018-11-01 19:37:32 +13:00
gfyoung
73322a0e55 Enable frozen string in app/controllers/**/*.rb
Enables frozen string for the following:

* app/controllers/*.rb
* app/controllers/admin/**/*.rb
* app/controllers/boards/**/*.rb
* app/controllers/ci/**/*.rb
* app/controllers/concerns/**/*.rb

Partially addresses #47424.
2018-09-18 21:22:45 -07:00
Bob Van Landuyt
148816cd67 Port read_cross_project ability from EE 2018-02-22 17:11:36 +01:00
🙈 jacopo beschi 🙉
729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Michael Kozono
49697bc8df Refactor to more robust implementation
In order to avoid string manipulation or modify route params (to make them unambiguous for `url_for`), we are accepting a behavior change:

When being redirected to the canonical path for a group, if you requested a group show path starting with `/groups/…` then you’ll now be redirected to the group at root `/…`.
2017-05-19 09:13:27 -07:00
Michael Kozono
f9785dcec3 Fix ensure_canonical_path for top level routes
Don’t replace a substring of the path if it is part of the top level route.

E.g. When redirecting from `/groups/ups` to `/groups/foo`, be careful not to do `/grofoo/ups`.

Projects are unaffected by this issue, but I am grouping the `#ensure_canonical_path` tests similar to the group and user tests.
2017-05-18 16:24:10 -07:00
Michael Kozono
52aba709ff Fix #32506
The host should not be modified, nor is it needed for the redirect.
2017-05-18 09:36:15 -07:00
Michael Kozono
ab98f8b5b1 Fix redirect message for groups and users 2017-05-11 15:28:13 -07:00
Michael Kozono
f05469f99b Resolve discussions 2017-05-05 12:12:50 -07:00
Michael Kozono
9e48f02ea8 Dry up routable lookups. Fixes #30317
Note: This changes the behavior of user lookups (see the spec change) so it acts the same way as groups and projects. Unauthenticated clients attempting to access a user page will be redirected to login whether the user exists and is publicly restricted, or does not exist at all.
2017-05-05 12:12:50 -07:00
Michael Kozono
e4bcc90d95 Add “project moved” flash message on redirect 2017-05-05 12:12:50 -07:00
Michael Kozono
7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00