Commit Graph

152 Commits

Author SHA1 Message Date
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
http://jneen.net/ 846e581732 use a magic default :global symbol instead of nil
to make sure we mean the global permissions
2017-03-09 11:49:52 -08:00
Z.J. van de Weg 449ecd6c68 Merge branch 'master' into zj-create-mattermost-team 2017-03-06 08:55:35 +01:00
Phil Hughes 8fd5aeee7f Fixed filter_projects param still used in group controller 2017-03-03 16:37:28 +02:00
Z.J. van de Weg 28910ffddf Fix linter errors 2017-03-03 09:01:54 +01:00
Z.J. van de Weg 52c4a7866e Improve UX 2017-03-02 10:21:29 +01:00
Luke "Jared" Bennett 173e27d62a
Finished up mattermost team creation 2017-02-22 10:19:42 +00:00
Z.J. van de Weg 444d71e043 Transactional mattermost team creation
Before this commit, but still on this feature branch, the creation of
mattermost teams where a background job. However, it was decided it was
better that these happened as transaction so feedback could be displayed
to the user.
2017-02-20 13:41:50 +01:00
Z.J. van de Weg 8ddbc43576 Improve DRYness of views 2017-02-16 09:19:28 +01:00
Z.J. van de Weg 1a0e54b32d Add tests for Mattermost team creation 2017-02-16 09:19:02 +01:00
Dmitriy Zaporozhets 059d1ae4c8 Merge branch 'dz-create-nested-groups-via-ui' into 'master'
Allow creating nested group via UI

See merge request !8786
2017-02-09 08:32:40 +00:00
dixpac 0dacf3c169 Fix inconsistent naming for services that delete things
* Changed name of delete_user_service and worker to destroy
* Move and change delete_group_service to Groups::DestroyService
* Rename Notes::DeleteService to Notes::DestroyService
2017-02-08 09:16:43 +01:00
Dmitriy Zaporozhets f39dbf3d3d
Allow creating nested group via UI
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-07 15:37:36 +02:00
Adam Pahlevi 538d1bffec resolve deprecation warnings
don’t pass AR object, use the ID to avoid depr warning

pass in the id instead of AR object to specs for `ProjectDestroyWorker`
2017-01-31 06:37:05 +07:00
Rémy Coutable 9e0d3906b9 Refactor authorized params in GroupsController
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-12 17:33:21 -05:00
Dmitriy Zaporozhets 23fc1f666c Merge branch 'dz-nested-group-misc' into 'master'
Miscellaneous improvements to the nested groups feature

See merge request !8308
2016-12-29 18:51:29 +00:00
Dmitriy Zaporozhets 10de4e3bb6
Show nested groups tab on group page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-26 14:19:42 +02:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
James Lopez b902784dbf fix reset path 2016-12-21 14:21:18 +01:00
James Lopez 4c3ec579e5 added more specs 2016-12-21 13:29:27 +01:00
James Lopez fd5062a848 update controller action to render error in form 2016-12-21 11:50:31 +01:00
James Lopez b82fdf6257 Fix error 500 renaming group. Also added specs and changelog. 2016-12-20 17:52:27 +01:00
Patricio Cano 02ddb9dff4 Syntax fixes and better tests for helper methods. Updated docs. 2016-09-15 14:10:49 -05:00
Patricio Cano fd62142950 Added group-specific setting for LFS.
Groups can enable/disable LFS, but this setting can be overridden at the project level. Admin only
2016-09-15 12:27:32 -05:00
Stan Hu cb8a425ba4 Fix bug where destroying a namespace would not always destroy projects
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:

1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
   :remove_project) is `false` because the user no longer has permission to
   destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.

Projects without a namespace or group also adds another problem: it's not possible to destroy the container
registry tags, since container_registry_path_with_namespace is the wrong value.

The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.

Closes #17893
2016-08-11 15:36:35 -07:00
Felipe Artur 4d69cb9d94 Allow to disable user request access to groups/projects 2016-07-20 14:38:21 +02:00
Felipe Artur 36d48120f6 merge master into issue_3359_3 2016-06-29 11:04:18 -03:00
Felipe Artur 8447c6b180 Insert notification settings dropdown into groups 2016-06-22 10:44:20 -03:00
Felipe Artur 92e183542f Insert notification settings dropdown into groups 2016-06-22 10:38:42 -03:00
Dmitriy Zaporozhets ec3f4f5bf0
Projects on group page should be sorted by last activity instead of id/created_at
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-04-14 11:00:24 +02:00
Douwe Maan ae7b2ef62c Merge branch 'master' into issue_12658
# Conflicts:
#	app/models/issue.rb
#	app/views/projects/_home_panel.html.haml
#	app/views/shared/projects/_project.html.haml
#	db/schema.rb
#	spec/models/project_spec.rb
2016-03-21 23:22:21 +01:00
Douwe Maan 3058a8fa4c Fix "Shared projects" tab 2016-03-20 21:30:08 +01:00
Douwe Maan 8db1292139 Tweaks, refactoring, and specs 2016-03-20 21:04:07 +01:00
Robert Speicher 085538c2bd Use the configured Kaminari "per page" default 2016-03-19 17:37:54 -04:00
Zeger-Jan van de Weg b959ae553b Improve group visibility level feature 2016-03-18 16:58:04 -03:00
Felipe Artur 0a7f716119 Code fixes 2016-03-17 19:42:46 -03:00
Felipe Artur 44c127447b Merge 4009-external-users into issue_12658 2016-03-16 20:16:42 -03:00