Commit Graph
1917 Commits
Author SHA1 Message Date
Dmitriy Zaporozhets 342d553709 Rename abilities to correspond contoller/model action names
write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:55:56 +02:00
Dmitriy Zaporozhets d5947ada44 Simplify set of assignee, milestone and label to admin_issue rule
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:45:45 +02:00
Dmitriy Zaporozhets d315d1eba4 Dont allow guest to set assigne, milestone and label when create new issue or merge request
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-25 15:38:04 +02:00
Dmitriy Zaporozhets 0c8b96bdbc Merge branch 'performance-improvements' into 'master'
Performance improvements

* store @participants in variable
* store result of subscribed? call into variable

In total it reduce amount of SQL queries for issue or merge_request with 10 comments/participants almost twice.

See merge request !883
2015-06-25 08:14:03 +00:00
Dmitriy Zaporozhets a5f23435f7 Improve performance for issue#show page
* store @participants in variable
* store result of subscribed? call into variable

In total it reduce amount of SQL queries for issue with 10 comments/participants twice.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-24 12:49:34 +02:00
Douwe Maan 43b444f40a Merge branch 'rs-issue-1850' into 'master'
Only look up Commit authors/committers by email

- Removes looking up authors/committers by name
- Renames `User.find_for_commit` to `User.find_by_any_email`

Closes #1850

See merge request !878
2015-06-24 09:47:13 +00:00
Robert Speicher 7e4829c3e9 Allow user to remove public email address 2015-06-23 21:22:00 -04:00
Robert Speicher e9b65a3e05 Only look up Commit authors/committers by email
- Removes looking up authors/committers by name
- Renames `User.find_for_commit` to `User.find_by_any_email`
2015-06-23 18:07:15 -04:00
Dmitriy Zaporozhets 21e227d870 Validate presence of provider field in Identity
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-23 11:21:23 +02:00
Dmitriy Zaporozhets f189c36d8d Merge branch 'rs-dev-issue-2414' into 'master'
Allow Admin to filter users by 2FA status

> ![Screen_Shot_2015-06-19_at_4.38.12_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/deba7f2a6b8d1548c1d1ac401e0e35a1/Screen_Shot_2015-06-19_at_4.38.12_PM.png)

Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2414

See merge request !852
2015-06-23 08:48:22 +00:00
Robert Speicher dcfce8b198 Use alias_attribute to define User#two_factor_enabled 2015-06-22 21:14:07 -04:00
Dmitriy Zaporozhets cc9b5c49d1 Merge branch 'revert-mr-state-names'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	features/steps/project/merge_requests.rb
2015-06-22 15:43:09 +02:00
Robert SpeicherandDmitriy Zaporozhets 2120e2dd95 Replace remaining references to Note.create_cross_reference_note 2015-06-22 12:13:46 +02:00
Dmitriy Zaporozhets 75f7a9648e Merge branch 'web-editor-autocrlf' into 'master'
Convert CRLF newlines to LF when committing using the web editor.

Fixes #1823 and https://github.com/gitlabhq/gitlabhq/issues/7950.

Depends on https://gitlab.com/gitlab-org/gitlab_git/merge_requests/29 being merged and a new gitlab_git being released.

cc @jacobvosmaer

See merge request !858
2015-06-22 10:11:26 +00:00
Dmitriy Zaporozhets 29b6d465a7 Merge branch 'rs-dev-issue-2355' into 'master'
MergeRequest#show performance improvements

This is a first pass on improving the performance of the `MergeRequests#show` page. Notable changes:

- The "Commits" tab is loaded lazily, so the initial page load should be much faster for MRs with many commits.
- Relative timestamps via `timeago` are only initialized once per load instead of `O(n^2)`. This greatly improves frontend rendering times for a large number of commits.
- Refactored `User.find_for_commit` to use a single ARel-generated SQL query instead of the old method which resulted in one query, and could result in up to three.

See merge request !838
2015-06-22 09:48:49 +00:00
Dmitriy Zaporozhets ea9dda9541 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-06-22 11:26:33 +02:00
Robert Speicher d3ff8c1a95 Make default value for otp_required_for_login false instead of null 2015-06-20 19:40:48 -04:00
Douwe Maan 0734756ee4 Convert CRLF newlines to LF when committing using the web editor. 2015-06-20 14:35:24 +02:00
Douwe Maan c0df5ff126 Merge branch 'snippet_optional_filename' into 'master'
Make snippet filename optional.

Fixes #2384.

See merge request !1866
2015-06-20 10:47:06 +00:00
Douwe Maan b2eef41d41 Merge branch 'fix-error-500-internal-snippet' into 'master'
Fix Error 500 when one user attempts to access another's personal, internal snippet

### What does this MR do?

This MR fixes an Error 500 that occurred if one user tried to access another's personal, internal snippet. Steps to reproduce:

### Why was this MR needed?

1. Go to `<hostname>/snippets/new`.
2. Select "Internal".
3. Create a snippet. Save the URL (e.g. `<hostname>/snippets/20`)
4. Logout and sign in as another user.
5. Go to the URL in step 3.

### What are the relevant issue numbers?

Closes #1815

See merge request !854
2015-06-20 10:38:33 +00:00
Stan Hu e785b9d2e2 Fix Error 500 when one user attempts to access a personal, internal snippet
Closes #1815
2015-06-19 21:23:46 -07:00
Nicolas aecc989154 Make snippet filename optional.
Fixes #2384.
2015-06-20 01:06:57 +02:00
Robert Speicher 516b4c1248 Allow Admin to filter users by 2FA status 2015-06-19 16:35:53 -04:00
Robert Speicher 6c8f0fe906 Add convenience methods to User for getting and setting 2FA status 2015-06-19 14:59:42 -04:00
Robert Speicher 7964e7d6a1 Move the User dashboard enum further up in the class 2015-06-19 14:59:07 -04:00
Dmitriy Zaporozhets 7524d7c082 Revert merge request states renaming
Replaced:
* "Accepted" with "Merged"
* "Rejected" with "Closed"

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-19 17:09:50 +02:00
Douwe Maan 0e615a4863 Merge branch 'fix-labels-permisssion-check' into 'master'
Fix 403 Access Denied error messages when accessing Labels section in a project

This would occur if the project's issues or merge requests features were disabled. The change in 9bcd36396b caused `can?(current_user, :read_merge_request, project)` to be false if the merge request feature were disabled, so `authorize_labels!` needs to be changed accordingly.

Closes #1813

See merge request !836
2015-06-18 11:43:32 +00:00
Stan Hu 07efb17e10 Fix 403 Access Denied error messages when accessing Labels section in a project that has MRs disabled but issues enabled
Closes #1813
2015-06-18 03:15:05 -07:00
Robert Speicher 7e31a369f5 Spec and refactor User.find_for_commit
Now it executes a single query instead of a possible three at the cost
of some scary-looking ARel calls.
2015-06-17 16:37:11 -04:00
swellard 19e5b043fe Fix duplicate 'Email has already been taken' message when creating a user, updated comments 2015-06-16 14:24:05 +01:00
swellard 98615ef536 Fix duplicate 'Email has already been taken' message when creating a user 2015-06-16 14:24:05 +01:00
Dmitriy Zaporozhets 0674bf2339 Look for .gitlab-ci.yml only if checkout_sha is present
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-15 17:54:42 +02:00
Dmitriy Zaporozhets 6c7131b469 Merge branch 'fix-ext-issue-tracker-hook' into 'master'
Fix external issue tracker hook/test for HTTPS URLs

If HTTPS was used for the 'project_url' of an external issue tracker, an
error was raised because a HTTP connection was established to the
default HTTPS port.

The code has been corrected and simplified by using HTTParty.
Additionally, the request now is made directly to the 'project_url'
instead of the extracted root path.

## The bug is reproducible on gitlab.com
1. Set up a new external issue service (I used Redmine)
2. Set the project URL to 'http://example.com/redmine/projects/x' and
  click on 'Test settings' => Ok
3. Now set the URL to 'https://example.com/redmine/projects/x' and test
  it again => 500

## What is actually happening?
Web servers behave differently when a non-SSL connection is established
to a SSL port:
- Nginx / Apache 2.4: Status code 400
- Apache 2.2: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">...
  (no status code line is sent)
- example.com: Empty response, no status code line

## Relevant log entries
```
2015-06-04T11:10:47.972Z 16785 TID-exfks WARN: {"retry"=>true, "queue"=>"project_web_hook", "class"=>"ProjectServiceWorker", "args"=>[...], "error_message"=>"wrong status line: \"<!DOCTYPE HTML PUBLIC \\\"-//IETF//DTD HTML 2.0//EN\\\">\"", "error_class"=>"Net::HTTPBadResponse", ...}
2015-06-04T11:10:47.972Z 16785 TID-exfks WARN: wrong status line: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"
2015-06-04T11:10:47.972Z 16785 TID-exfks WARN: /usr/lib/ruby/2.1.0/net/http/response.rb:41:in `read_status_line'
[...]
/home/git/gitlab-7.11.4/app/models/project_services/issue_tracker_service.rb:88:in `execute'
/home/git/gitlab-7.11.4/app/workers/project_service_worker.rb:8:in `perform'
[...]
```

See merge request !767
2015-06-15 14:01:10 +00:00
Dmitriy Zaporozhets 7300729190 Merge branch 'rs-dev-issue-2228' into 'master'
Allow user to customize default Dashboard page

Renames the "Design" profile page to "Preferences" and adds a field to customize the default Dashboard page:

> ![Screen_Shot_2015-06-11_at_11.12.53_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b5282a3be7861d1148528c6bc9e7a0e0/Screen_Shot_2015-06-11_at_11.12.53_PM.png)

See merge request !778
2015-06-15 11:29:36 +00:00
Dmitriy Zaporozhets b645f0f432 Merge pull request #9340 from jvanbaarsen/update-noteable
Update noteable after a new note is added
2015-06-14 12:46:07 +02:00
Robert Speicher 2bc4fd2d04 Add dashboard attribute to User model 2015-06-13 17:59:11 -04:00
Robert Speicher 567a25b630 Ensure session_expire_delay field exists before accessing it
Closes #1798
2015-06-13 00:31:08 -04:00
Douwe Maan 9ea8dcb5e2 Merge branch 'feature-session-expire-seconds-ui' into 'master'
Add session expiration delay configuration through UI application

Setting is accessible by the administrator through the UI and defaults to 1 week (the current setting)

Answers the following suggestions:

  * http://feedback.gitlab.com/forums/176466-general/suggestions/6210719-make-session-length-configurable
  * http://feedback.gitlab.com/forums/176466-general/suggestions/6730512-automatic-logout-after-a-time-being-idle

See merge request !774
2015-06-12 13:50:40 +00:00
Dmitriy Zaporozhets 21a62bb995 Merge branch 'refactor-mr-widget' into 'master'
Refactor accept merge request widget

* make each case a simple view
* separate  merge request JS from merge request accept widget JS

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !799
2015-06-12 08:22:13 +00:00
Dmitriy Zaporozhets c69ca9912e Merge pull request #9371 from zenati/patch-2
An `in_namespace` scope is already present
2015-06-11 23:09:41 +02:00
Dmitriy Zaporozhets 946b4ceda3 Improve variables in mr widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 18:45:12 +02:00
Dmitriy Zaporozhets 644b6ba993 Refactor accept merge request widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 09:40:26 +02:00
themaze75andEric Maziade 1d080f5745 session_expire_seconds => session_expire_delay
delay is in seconds
more legible code in session_store
Added `GitLab restart required` help block to session_expire_delay
2015-06-10 22:10:00 -04:00
Robert Speicher 94cbf0091f Fix taskable require 2015-06-10 01:38:45 -04:00
Robert Speicher 33df3ed384 Add respond_to_missing? for Commit and Repository
As of Ruby 1.9, this is the correct way to handle `respond_to?` for
methods implemented by `method_missing`.

See https://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding
2015-06-10 01:31:27 -04:00
zenati b0de6e9ae2 An in_namespace scope is already present 2015-06-09 13:42:01 +02:00
Robert Speicher 23954b0f77 Correctly remove already-mentioned commits for cross references
Fixes #1778
2015-06-08 18:13:14 -04:00
Eric Maziade 84a414fe53 Add session expiration delay configuration through UI application
settings
2015-06-05 11:50:37 -04:00
Daniel Gerhardt 7f3eb42f4e Fix external issue tracker hook/test for HTTPS URLs
If HTTPS was used for 'project_url', an error was raised because a HTTP
connection was established to the default HTTPS port.

The code has been corrected and simplified by using HTTParty.
Additionally, the request now is made directly to the 'project_url'
instead of the extracted root path.
2015-06-05 17:00:19 +02:00
Jeroen van Baarsen fbdaf0e2a5 Update noteable after a new note is added
**What does this do?**
It makes sure that whenever a new note is added to an noteable item, the
updated_at of that item is also updated.

**Why is this needed?**
At this moment when you post a comment on an issue or add a label to an issue,
the updated_at is not changed. Because of this the filtering for least recently
updated is not really useful (since it only takes in account the original text
from the noteable).

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-06-05 15:22:55 +02:00