Commit Graph

58 Commits

Author SHA1 Message Date
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
Dmitriy Zaporozhets c5f56ee8a0 Restyle admin:group:show. Remove .all calls fro users, projects here 2013-06-10 15:58:51 +03:00
Kyle Kelley 65e8b18190 s/was/were/ for plural subjects 2013-04-09 22:43:02 -04:00
Andrey Kumanyaev 9d318db48f Added the correct hierarchy of controllers for the administrative part 2013-01-24 22:31:24 +02:00
Dmitriy Zaporozhets d075df56d3 Improve perfomance of removeing group 2012-12-30 14:26:19 +02:00
Andrey Kumanyaev 98044f0f14 Code duplication removed from controllers 2012-12-26 20:30:11 +04:00
Andrey Kumanyaev 1e3d238910 Replace short loop variable from "p" to "project" 2012-12-26 19:52:15 +04:00
Andrey Kumanyaev 9c574464a6 Add functional in admin section 2012-12-26 19:52:15 +04:00
Dmitriy Zaporozhets bf13579b92 Make admin sorting more obvious 2012-12-10 06:14:05 +03:00
Dmitriy Zaporozhets ba74fa1413 Remove some bugs. Add warnings for renaming group. Add ability to cahnge group owner. 2012-12-03 21:14:05 +03:00