summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
* Reporter role can manage issue tracker nowreporter-manage-issuesDmitriy Zaporozhets2015-06-301-4/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Refactor issue, mr, note abilities to include project abilities tooDmitriy Zaporozhets2015-06-261-13/+30
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Change dynamic abilities to new formatDmitriy Zaporozhets2015-06-261-11/+7
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Rename abilities to correspond contoller/model action namesrename-abilitiesDmitriy Zaporozhets2015-06-261-13/+13
| | | | | | | | | | | | | | | | | 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>
* Simplify set of assignee, milestone and label to admin_issue ruleDmitriy Zaporozhets2015-06-261-4/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Dont allow guest to set assigne, milestone and label when create new issue ↵Dmitriy Zaporozhets2015-06-251-0/+3
| | | | | | or merge request Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'performance-improvements' into 'master'Dmitriy Zaporozhets2015-06-251-3/+5
|\ | | | | | | | | | | | | | | | | | | | | 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
| * Improve performance for issue#show pageDmitriy Zaporozhets2015-06-241-3/+5
| | | | | | | | | | | | | | | | | | * 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>
* | Merge branch 'rs-issue-1850' into 'master'Douwe Maan2015-06-242-10/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 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
| * Only look up Commit authors/committers by emailrs-issue-1850Robert Speicher2015-06-232-10/+6
| | | | | | | | | | - Removes looking up authors/committers by name - Renames `User.find_for_commit` to `User.find_by_any_email`
* | Allow user to remove public email addressrs-dev-issue-2419Robert Speicher2015-06-231-1/+3
|/
* Validate presence of provider field in Identityidentity-validationDmitriy Zaporozhets2015-06-231-0/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branch 'rs-dev-issue-2414' into 'master'Dmitriy Zaporozhets2015-06-231-18/+16
|\ | | | | | | | | | | | | | | | | | | 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
| * Use alias_attribute to define User#two_factor_enabledrs-dev-issue-2414Robert Speicher2015-06-221-14/+3
| |
| * Make default value for otp_required_for_login false instead of nullRobert Speicher2015-06-201-4/+4
| |
| * Allow Admin to filter users by 2FA statusRobert Speicher2015-06-191-4/+13
| |
* | Merge branch 'revert-mr-state-names'Dmitriy Zaporozhets2015-06-222-6/+14
|\ \ | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: features/steps/project/merge_requests.rb
| * | Revert merge request states renamingDmitriy Zaporozhets2015-06-192-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | Replaced: * "Accepted" with "Merged" * "Rejected" with "Closed" Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | Replace remaining references to `Note.create_cross_reference_note`Robert Speicher2015-06-222-6/+1
| | |
* | | Merge branch 'web-editor-autocrlf' into 'master'Dmitriy Zaporozhets2015-06-221-1/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Convert CRLF newlines to LF when committing using the web editor.web-editor-autocrlfDouwe Maan2015-06-201-1/+6
| | | |
* | | | Merge branch 'rs-dev-issue-2355' into 'master'Dmitriy Zaporozhets2015-06-221-4/+20
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Spec and refactor User.find_for_commitRobert Speicher2015-06-171-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Now it executes a single query instead of a possible three at the cost of some scary-looking ARel calls.
* | | | | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceDmitriy Zaporozhets2015-06-222-5/+16
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge branch 'fix-error-500-internal-snippet' into 'master'Douwe Maan2015-06-201-1/+1
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | Fix Error 500 when one user attempts to access a personal, internal snippetStan Hu2015-06-191-1/+1
| | | |/ | | |/| | | | | | | | | Closes #1815
| * | | Add convenience methods to User for getting and setting 2FA statusRobert Speicher2015-06-191-0/+12
| | | |
| * | | Move the User dashboard enum further up in the classRobert Speicher2015-06-191-4/+3
| |/ /
* | | Merge branch 'snippet_optional_filename' into 'master'Douwe Maan2015-06-201-1/+0
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | Make snippet filename optional. Fixes #2384. See merge request !1866
| * | Make snippet filename optional.Nicolas2015-06-201-1/+0
| | | | | | | | | | | | Fixes #2384.
* | | Merge branch 'fix-labels-permisssion-check' into 'master'Douwe Maan2015-06-181-0/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | 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 9bcd36396b9 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
| * | Fix 403 Access Denied error messages when accessing Labels section in a ↵Stan Hu2015-06-181-0/+1
| | | | | | | | | | | | | | | | | | project that has MRs disabled but issues enabled Closes #1813
* | | Fix duplicate 'Email has already been taken' message when creating a user, ↵swellard2015-06-161-1/+1
| | | | | | | | | | | | updated comments
* | | Fix duplicate 'Email has already been taken' message when creating a userswellard2015-06-161-1/+3
|/ /
* | Look for .gitlab-ci.yml only if checkout_sha is presentfix-gitlab-ci-ymlDmitriy Zaporozhets2015-06-151-9/+13
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch 'fix-ext-issue-tracker-hook' into 'master'Dmitriy Zaporozhets2015-06-151-10/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Fix external issue tracker hook/test for HTTPS URLsdgerhardt/gitlab-ce-fix-ext-issue-tracker-hookDaniel Gerhardt2015-06-051-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'rs-dev-issue-2228' into 'master'Dmitriy Zaporozhets2015-06-151-1/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Add `dashboard` attribute to User modelRobert Speicher2015-06-131-1/+6
| | | |
* | | | Merge pull request #9340 from jvanbaarsen/update-noteableDmitriy Zaporozhets2015-06-141-1/+1
|\ \ \ \ | |/ / / |/| | | Update noteable after a new note is added
| * | | Update noteable after a new note is addedJeroen van Baarsen2015-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **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>
* | | | Ensure `session_expire_delay` field exists before accessing itrs-issue-1798Robert Speicher2015-06-131-4/+4
| | | | | | | | | | | | | | | | Closes #1798
* | | | Merge branch 'feature-session-expire-seconds-ui' into 'master'Douwe Maan2015-06-121-0/+6
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | session_expire_seconds => session_expire_delaythemaze752015-06-101-2/+6
| | | | | | | | | | | | | | | | | | | | delay is in seconds more legible code in session_store Added `GitLab restart required` help block to session_expire_delay
| * | | Add session expiration delay configuration through UI applicationEric Maziade2015-06-051-0/+2
| | | | | | | | | | | | settings
* | | | Merge branch 'refactor-mr-widget' into 'master'Dmitriy Zaporozhets2015-06-121-0/+12
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Improve variables in mr widgetDmitriy Zaporozhets2015-06-111-0/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | Refactor accept merge request widgetDmitriy Zaporozhets2015-06-111-0/+8
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | Merge pull request #9371 from zenati/patch-2Dmitriy Zaporozhets2015-06-112-4/+6
|\ \ \ \ \ | |/ / / / |/| | | | An `in_namespace` scope is already present
| * | | | An `in_namespace` scope is already presentzenati2015-06-092-4/+6
| | | | |