Commit Graph

267 Commits

Author SHA1 Message Date
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Robert Speicher c89849af47 Merge branch 'backport-ee-4b464eaaee' into 'master'
Backport avatar-related spec changes from gitlab-org/gitlab-ee@4b464eaaee

See merge request !11072
2017-05-05 14:01:08 +00:00
Ruben Davila b396668ec5 Add CHANGELOG entry, some specs and locale file for German. 2017-05-04 18:44:19 -05:00
Rémy Coutable f1ace97f8b Backport avatar-related spec changes from gitlab-org/gitlab-ee@4b464eaaee
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-04 17:04:36 +02:00
Bob Van Landuyt 08b1bc3489 Reject group-routes as names of child namespaces 2017-05-01 11:14:24 +02:00
Douwe Maan b9e573db57 Skip validation when creating internal (ghost, service desk) users 2017-04-26 14:13:13 -05:00
Sean McGivern 33a25e0fc6 Merge branch 'uassign_on_member_removing' into 'master'
Unassign all Issues and Merge Requests when member leaves a team

Closes #30768 and #24117

See merge request !10755
2017-04-20 12:42:41 +00:00
James Lopez 4190146110 Fix active user count 2017-04-19 12:11:04 +02:00
Valery Sizov 59a330f4cd Remove assigned_(issues|merge_requests) methods from the issuable 2017-04-18 21:07:45 +03:00
blackst0ne 11aff97d88 Remove the User#is_admin? method 2017-04-09 13:20:57 +11:00
Douwe Maan bef1aca883 Merge branch '28695-move-all-associated-records-to-ghost-user' into 'master'
Resolve "Deleting a user shouldn't delete associated records"

Closes #28695 and #30514

See merge request !10467
2017-04-06 18:54:57 +00:00
Timothy Andrew 1c42505b02
Implement review comments from @DouweM for !10467.
1. Have `MigrateToGhostUser` be a service rather than a mixed-in module, to keep
   things explicit. Specs testing the behavior of this class are moved into a
   separate service spec file.

2. Add a `user.reported_abuse_reports` association to make the
   `migrate_abuse_reports` method more consistent with the other `migrate_`
   methods.
2017-04-06 22:39:40 +05:30
Timothy Andrew 6a065074a3
Fix a bug with the User#abuse_report association.
Introduction
------------

1. The foreign key was not explicitly specified on the association.
2. The `AbuseReport` model contains two references to user - `reporter_id` and
   `user_id`
3. `user.abuse_report` is supposed to return the single abuse report where
   `user_id` refers to the given user.

Bug Description
---------------

1. `user.abuse_report` would return an abuse report where `reporter_id` referred
   to the current user, if such an abuse report was present.

2. This implies a slightly more serious bug as well:

   - Assume User A filed an abuse report against User B
   - We have an abuse report where `reporter_id` is User A and `user_id` is User B
   - If User A is updated (`user_a.block`, for example), the abuse report would
     also be updated, such that both `reporter_id` _and_ `user_id` point to User A.

Fix
---

Explicitly declare the foreign key `user_id` in the `has_one` declaration
2017-04-06 18:58:59 +05:30
Alexis Reigel 1735ed6139 rename cache db column with `_cached` suffix 2017-04-06 10:01:14 +02:00
Alexis Reigel 20575859b1 check all groups for 2fa requirement 2017-04-06 10:01:14 +02:00
Markus Koller a3430f011f Support 2FA requirement per-group 2017-04-06 10:01:13 +02:00
George Andrinopoulos 7c74a0209b Implement new service for creating user 2017-03-27 09:37:24 +00:00
Alexander Randa 7a1236031a Fix projects_limit RangeError on user create 2017-03-24 11:32:03 +00:00
Lin Jen-Shin 46287f3638 Make sure alias email would never match:
Hopefully this could fix:

https://gitlab.com/gitlab-org/gitlab-ce/builds/12431186

To make sure that the email would never contain "joh"
otherwise it would match to this `another_user`.
2017-03-17 17:54:56 +08:00
Sean McGivern d1df36e386 Merge branch 'refactor/global-permissions-for-internal-users' into 'master'
Refactor/global permissions for internal users

See merge request !9598
2017-03-13 11:04:33 +00:00
George Andrinopoulos ec660a6bc1 Resolve transient failure in spec/models/user_spec.rb 2017-03-13 10:05:15 +00:00
http://jneen.net/ bb0cba920a don't require ghost users to be blocked 2017-03-09 11:49:52 -08:00
Robert Speicher 23c2b8f6bb Add `has_many` associations for models that can have Upload records 2017-03-06 14:41:10 -05:00
Kamil Trzcinski 91ce04678e
Make triggers to be user aware 2017-03-05 18:53:00 +01:00
Douwe Maan 05f331f3ce
Fix access to projects shared with a nested group
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-28 14:18:20 +02:00
Timothy Andrew 53aa043724
Fix specs for the ghost user feature. 2017-02-24 16:50:21 +05:30
Timothy Andrew 8e68480976
Use a `ghost` boolean to track ghost users.
Rather than using a separate `ghost` state. This lets us have the benefits of
both ghost and blocked users (ghost: true, state: blocked) without having to
rewrite a number of queries to include cases for `state: ghost`.
2017-02-24 16:50:20 +05:30
Timothy Andrew ca16c3734b
Extract code from `Namespace#clean_path` for ghost user generation.
1. Create a `Uniquify` class, which generalizes the process of generating unique
   strings, by accepting a function that defines what "uniqueness" means in a
   given context.

2. WIP: Make sure tests for `Namespace` pass, add more if necessary.

3. WIP: Add tests for `Uniquify`
2017-02-24 16:50:19 +05:30
Timothy Andrew ff19bbd3b4
Deleting a user shouldn't delete associated issues.
- "Associated" issues are issues the user has created + issues that the
  user is assigned to.

- Issues that a user owns are transferred to a "Ghost User" (just a
  regular user with `state = 'ghost'` that is created when
  `User.ghost` is called).

- Issues that a user is assigned to are moved to the "Unassigned" state.

- Fix a spec failure in `profile_spec` — a spec was asserting that when a user
  is deleted, `User.count` decreases by 1. After this change, deleting a user
  creates (potentially) a ghost user, causing `User.count` not to change. The
  spec has been updated to look for the relevant user in the assertion.
2017-02-24 16:50:19 +05:30
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan 75f5fa997d Enable Rails/Delegate 2017-02-23 09:32:42 -06:00
Douwe Maan 206953a430 Prefer leading style for Style/DotPosition 2017-02-23 09:32:22 -06:00
Douwe Maan 3dadf306dd Enable Style/DotPosition 2017-02-23 09:31:56 -06:00
Annabel Dunstone Gray c780ad0e92 Remove all instances of theme_id; require downtime 2017-02-15 13:31:18 -06:00
Annabel Dunstone Gray 0667d1aa7f Drop theme ID from users table 2017-02-15 13:31:18 -06:00
Pawel Chojnacki e31b982a13 Make deploy key not show in User's keys list 2017-02-13 15:38:00 +01:00
Reza Mohammadi d9ee55ee38 Bypass signup domain validation for external users
Fixes #25279
2017-02-08 13:04:07 +03:30
Douwe Maan 50f5960c72 Merge branch 'ee-1439-read-only-user' into 'master'
Backport changes from gitlab-org/gitlab-ee!998

See merge request !8984
2017-02-07 04:10:13 +00:00
Douwe Maan 46dff6910d More backport 2017-02-06 17:19:37 -06:00
Douwe Maan 937cb72763 Update spec 2017-02-06 13:50:56 -06:00
Semyon Pupkov 3deb66ea56 Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
2017-02-05 13:11:45 +05:00
Robert Speicher e48a1755f4 Add traits for the different Event types to the Event factory 2017-02-01 16:02:03 -05:00
Robert Speicher fcb37542e7 Use `:empty_project` where possible in model specs 2017-01-26 17:44:59 -05:00
Dmitriy Zaporozhets 8a9597fc73 Merge branch 'dz-nested-groups-access-improvements' into 'master'
Nested groups feature improvemetns

See merge request !8448
2017-01-25 13:17:43 +00:00
Dmitriy Zaporozhets 52c5f9c97f
Add User#nested_groups and User#nested_projects methods
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-01-25 13:43:15 +02:00
Poornima M 8354c76f39 Fixing sort of Users so that users who never logged in will be displayed last
Adding changelog entry
2017-01-24 18:42:55 +05:30
Robert Speicher 1502d564fd Convert most User model specs to use `:empty_project` 2017-01-19 16:44:25 -05:00
Rémy Coutable d95b709a66
Be smarter when finding a sudoed user in API::Helpers
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-13 15:53:00 +01:00
Rémy Coutable 5186618bb0 Merge branch '25209-improve-length-validators' into 'master'
Use :maximum instead of :within for length validators with a 0..N range

Closes #25209

See merge request !7894
2016-12-07 10:31:21 +00:00