Commit Graph

67 Commits

Author SHA1 Message Date
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
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Lin Jen-Shin b23428d664 Bring changes from EE 2018-06-25 21:11:00 +08:00
blackst0ne 3d3b46f344 [Rails5] Rename `sort` methods to `sort_by_attribute` 2018-04-04 09:19:47 +00:00
Rémy Coutable 1c88d92b3f Improve Member services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-27 16:02:22 +01:00
Rémy Coutable 50d7c356c2
Present member collection at the controller level
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-12 18:14:58 +01: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
Nick Thomas 5c602e306c Limit non-administrators to adding 100 members at a time to groups and projects 2017-06-06 16:04:26 +01:00
Kushal Pandya 848204ba74 Show group name on flash container when group is created from Admin area 2017-04-25 12:43:21 +00:00
Dmitriy Zaporozhets bae1644015
Refactor Admin::GroupsController#members_update method and add some specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-20 19:25:02 +03:00
Markus Koller a3430f011f Support 2FA requirement per-group 2017-04-06 10:01:13 +02:00
Dmitriy Zaporozhets 8820f3cdd2 Merge branch 'dz-refactor-full-path' into 'master'
Store group and project full name and full path in routes table

See merge request !8979
2017-02-08 18:45:19 +00:00
Dmitriy Zaporozhets 2989192d1a
Store group and project full name and full path in routes table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-08 19:14:29 +02: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
Rémy Coutable 83c1395af2 Refactor authorized params in Admin::GroupsController
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-11 16:52:30 -05:00
Valery Sizov 684536321c Fix: Admin group show page does not work 2016-12-28 15:34:12 +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
Dmitriy Zaporozhets 83232be0e1
Add nested groups support on data level
* add parent_id field to namespaces table to store relation with nested groups
* create routes table to keep information about full path of every group and project
* project/group lookup by full path from routes table

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-08 11:47:16 +02:00
Rémy Coutable 924a6b7d33 New AccessRequestsFinder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 08:46:59 +02: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
Sean McGivern 64d45a87cd Fix adding a user to a group in admin section 2016-08-18 23:33:50 +01: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
Rémy Coutable bd78f5733c Exclude requesters from Project#members, Group#members and User#members
And create new Project#requesters, Group#requesters scopes.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-01 17:44:46 +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
Felipe Artur 8d544645f0 Add specs and add visibility level to admin groups 2016-03-21 19:11:24 -03:00
Robert Speicher 085538c2bd Use the configured Kaminari "per page" default 2016-03-19 17:37:54 -04:00
Yatish Mehta 6ac68d8cb0 Remove instance variable @group multiple assignment 2016-03-08 16:48:00 +01:00
Dmitriy Zaporozhets 61cfd1d273
Wrap group removal into service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 14:07:20 +02:00
Jeroen van Baarsen 5a4ebfb47a Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-04-20 15:39:37 +02:00
Douwe Maan 2b2bd402dc Track who created a group or project member. 2015-04-14 12:06:42 +02:00
Douwe Maan 31fc73f0a9 Use `project_member` instead of `team_member`. 2015-03-15 13:50:38 +01:00
Dmitriy Zaporozhets f0cbbd70bb Use same constant for amount of items per page 2015-03-12 15:37:00 -07:00
Dmitriy Zaporozhets bbca6a0abd Refactor sorting in project 2015-02-05 19:15:05 -08:00
Dmitriy Zaporozhets 62ed1c537e Explicitly define ordering in models using default_scope 2015-02-05 14:20:55 -08:00
Dmitriy Zaporozhets 52a8e5c01a
Set group name from path in admin controller
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-22 13:55:32 +02:00
Dmitriy Zaporozhets c69b8e0459
Huge replace of old users_project and users_group references
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 19:32:51 +03:00
Dmitriy Zaporozhets 8f60b5b4fc
Group and Event strong_params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 16:57:10 +03:00
Dmitriy Zaporozhets 9a4c8f7e41
Improve admin group page performance
Add pagination for projects and members to /admin/groups/:group page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-02 18:58:00 +03:00
skv a3f645ef51 Remove deprecated finders 2014-01-19 23:39:56 +04:00
Dmitriy Zaporozhets 65b9768ccf Group ownership completely based on users_groups relation now
Before we have only owner_id to determine group owner
With multiple owners per group we should get rid of owner_id in group.
So from now @group.owner will always be nil but
@group.owners return an actual array of users who can admin this group
2013-09-26 14:49:22 +03:00
Dmitriy Zaporozhets a5dbe35354 Improve change group ownership logic 2013-06-26 14:51:57 +03:00
Dmitriy Zaporozhets 102aaf0682 Use simple render syntax in controllers 2013-06-22 15:08:11 +03:00
Dmitriy Zaporozhets ee13297af2 Cleanup: removed unused routing/methods. Improved admin area usability 2013-06-22 14:11:20 +03:00
Dmitriy Zaporozhets 8d70ac008d Merge branch 'master' into 6-0-dev
Conflicts:
	VERSION
	db/schema.rb
2013-06-22 11:19:12 +03:00
Dmitriy Zaporozhets 86d9ed9a0a Fix user add to group from admin area 2013-06-20 12:06:44 +03:00
Dmitriy Zaporozhets 48019f1a0f Update admin area with new group memberships 2013-06-18 17:47:52 +03:00
Andrew Kumanyaev 26994b5d30 Remove unused, but slow code 2013-06-17 15:52:54 +04:00