Commit Graph

188 Commits

Author SHA1 Message Date
Gosia Ksionek 64858317ad Add part of needed code
Add columns to store project creation settings

Add project creation level column in groups
 and default project creation column in application settings

Remove obsolete line from schema

Update migration with project_creation_level column existence check

Rename migrations to avoid conflicts

Update migration methods

Update migration method
2019-04-05 18:49:46 +00:00
Illya Klymov ffbc66cc0b Redirect to edit page on group transfer failure 2019-04-03 11:29:35 +03:00
Gilbert Roulot 6ab102a2f8 Security Dashboard as default view for groups
Add a supporting code to separate groups#show
and groups#details which is required for the
proper implementation of the Group Overview
content and Security Dashboard option for it
2019-03-14 12:55:46 +00:00
Rubén Dávila 24226b9fe2 Update last_activity_on for Users on some main GET endpoints
In order to have an accurate date about the last activity of a User
we need to update the last_activity_on field when the User is visiting
some basic pages of GitLab like pages related to Dashboards, Projects,
Issues and Merge Requests
2019-02-05 09:55:31 -05:00
Mario de la Ossa 49c74068ae
Save sorting preference for Issues/MRs in BE
In order to let users' sorting preferences transfer between devices, we
save the preference for issues and MRs (one preference for issues, one
for MRs) in the backend inside the UserPreference object
2019-01-28 12:48:05 -06:00
Cindy Pallares fe5f75930e
Merge branch 'security-fix-pat-web-access' into 'master'
[master] Resolve "Personal access token with only `read_user` scope can be used to authenticate any web request"

See merge request gitlab/gitlabhq!2583
2018-11-28 19:13:59 -05: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
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Dennis Tang 5b74a1aebc Resolve "Improve handling of projects shared with a group" 2018-09-07 06:09:13 +00:00
Winnie Hellmann 743add978a Move badge settings to general settings 2018-09-03 13:16:23 +00:00
Mike Greiling 308a07f365
ensure all group settings panels remain open after form submission 2018-08-08 01:24:36 -05:00
Sean McGivern 320ae8ff4a Merge branch 'blackst0ne-rails5-add-safe-params-helper' into 'master'
[Rails5] Add `safe_params` helper

See merge request gitlab-org/gitlab-ce!18241
2018-04-18 10:26:44 +00:00
Yorick Peterse daad7144ec
Support Markdown rendering using multiple projects
This refactors the Markdown pipeline so it supports the rendering of
multiple documents that may belong to different projects. An example of
where this happens is when displaying the event feed of a group. In this
case we retrieve events for all projects in the group. Previously we
would group events per project and render these chunks separately, but
this would result in many SQL queries being executed. By extending the
Markdown pipeline to support this out of the box we can drastically
reduce the number of SQL queries.

To achieve this we introduce a new object to the pipeline:
Banzai::RenderContext. This object simply wraps two other objects: an
optional Project instance, and an optional User instance. On its own
this wouldn't be very helpful, but a RenderContext can also be used to
associate HTML documents with specific Project instances. This work is
done in Banzai::ObjectRenderer and allows us to reuse as many queries
(and results) as possible.
2018-04-11 14:10:19 +02:00
blackst0ne eddf3febd7 [Rails5] Add `safe_params` helper
Rails 5.0 requires to explicitly permit attributes when building a URL
using current `params` object.

The `safe_params` helper allows developers to just call `safe_params.merge(...)`
instead of manually adding `permit` to every call.

https://github.com/rails/rails/pull/20868
2018-04-08 15:35:30 +11:00
Sean McGivern 868cb4307f Fix subgroup issue and MR pages empty states and counts
Previously, these wouldn't count issues or MRs in subgroups - meaning that if
_this_ group had no issues or MRs, we'd show the empty state, which was wrong.
2018-02-27 10:32:29 +00:00
Bob Van Landuyt 148816cd67 Port `read_cross_project` ability from EE 2018-02-22 17:11:36 +01:00
Mayra Cabrera 68a419c879 31885 - Ability to transfer a single group to another group 2018-02-06 00:10:58 +00:00
James Lopez 406e10b89c
refactor groups controller to match EE 2018-01-31 16:23:15 +01:00
Stan Hu 30e6cfa05a Fix not all events being shown in group dashboard
The group activity feed was limited to the first 20 projects found
in the group, which caused activity from some projects to be omitted.
A limit of 20 is applied to the query for events, so the
extra pagination does little in the way of performance.

Closes #42560
2018-01-30 17:04:22 -08:00
Francisco Javier López bf0331dc72 Resolve "DashboardController#activity.json is slow due to SQL" 2017-11-06 16:52:56 +00:00
Bob Van Landuyt 69eba88532 Make sure we render events for projects within a group 2017-10-20 17:02:02 +03:00
Douwe Maan 79e889122b Merge branch 'bvl-group-trees' into 'master'
Show collapsible tree on the project show page

Closes #30343

See merge request gitlab-org/gitlab-ce!14055
2017-10-17 10:03:03 +00:00
Bob Van Landuyt 2c25a7ae34 Nest the group_children_path inside the canonical group path 2017-10-12 11:36:55 +02:00
Vitaliy @blackst0ne Klachkov 64bb19069d Add support for markdown preview to group milestones 2017-10-11 20:03:19 +11:00
Bob Van Landuyt aee5691db3 Don't load unneeded elements in GroupsController#show 2017-10-10 16:54:28 +02:00
Bob Van Landuyt 3fe7f31ac0 Use `GroupFinder` to check if a user can read a group 2017-10-10 14:09:56 +02:00
Bob Van Landuyt 22aa034427 Rename `GroupHierarchy` to `GroupDescendant` 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 31f7756893 `current_user:` as a keyword argument 2017-10-04 22:49:41 +02:00
Bob Van Landuyt e3daa73fbf Setup children in a a method and reuse for both calls 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 8f6dac4991 Allow filtering children for a group
When fetching children for a group with a filter, we will search all
nested groups for results and render them in an expanded tree
2017-10-04 22:49:41 +02:00
Bob Van Landuyt 518216c062 Merge group hierarchies when parents are shared 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 28c440045e Add pagination for children 2017-10-04 22:46:49 +02:00
Bob Van Landuyt 80780018a9 Update `children` route to handle projects and groups 2017-10-04 22:46:49 +02:00
Bob Van Landuyt d33e15574b Add serializer for group children 2017-10-04 22:46:49 +02:00
Bob Van Landuyt 376a8c66c1 Remove the subgroups path on a group 2017-10-04 22:46:49 +02:00
Bob Van Landuyt 2eac1537ad Fetch children using new finder for the `show` of a group. 2017-10-04 22:46:49 +02:00
Ruben Davila 62bb6235c2 Make Members with Owner and Master roles always able to create subgroups 2017-09-07 13:47:58 -05:00
Tiago Botelho 5bc9dedf40 Improves subgroup creation permissions 2017-08-21 15:40:22 +01:00
Yorick Peterse aac1de46c9
Use a specialized class for querying events
This changes various controllers to use the new EventCollection class
for retrieving events. This class uses a JOIN LATERAL query on
PostgreSQL to retrieve queries in a more efficient way, while falling
back to a simpler / less efficient query for MySQL.

The EventCollection class also includes a limit on the number of events
to display to prevent malicious users from cycling through all events,
as doing so could put a lot of pressure on the database.

JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
and as such this optimisation is only used when using PostgreSQL 9.3 or
newer.
2017-08-10 17:45:49 +02:00
Tieu-Philippe KHIM 3c1700cde6 Refactor atom builder by using xml.atom layout 2017-06-12 19:21:13 +02:00
blackst0ne a544e46bb0 Add a rubocop rule to check if a method 'redirect_to' is used without explicitly set 'status' in 'destroy' actions of controllers 2017-06-07 09:45:16 +11:00
Douwe Maan 26bcef97d6 Merge branch 'rework-authorizations-performance' into 'master'
Rework project authorizations and nested groups for better performance

See merge request !10885
2017-05-29 15:49:56 +00:00
Douwe Maan e45e540d1d Consistently display last push event widget 2017-05-25 15:21:30 -05: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
Yorick Peterse 34974258bc
Hide nested group UI/API support for MySQL
This hides/disables some UI elements and API parameters related to
nested groups when MySQL is used, since nested groups are not supported
for MySQL.
2017-05-17 20:53:16 +02:00
Douwe Maan ea4eb46047 Merge branch 'tc-fix-private-subgroups-shown' into 'security'
Use GroupsFinder to find subgroups the user has access to

See merge request !2096
2017-05-10 16:48:18 +02:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Douwe Maan 514dc1a084 Merge branch 'feature/enforce-2fa-per-group' into 'master'
Support 2FA requirement per-group

See merge request !8763
2017-04-06 15:50:16 +00:00
Markus Koller a3430f011f Support 2FA requirement per-group 2017-04-06 10:01:13 +02:00
Jacopo b996a82ff4 ProjectsFinder should handle more options
Extended ProjectFinder in order to handle the following options:
 - current_user - which user use
 - project_ids_relation: int[] - project ids to use
 - params:
   -  trending: boolean
   -  non_public: boolean
   -  starred: boolean
   -  sort: string
   -  visibility_level: int
   -  tags: string[]
   -  personal: boolean
   -  search: string
   -  non_archived: boolean

GroupProjectsFinder now inherits from ProjectsFinder.
Changed the code in order to use the new available options.
2017-04-06 07:11:37 +02:00