summaryrefslogtreecommitdiff
path: root/app/controllers
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'dev/master'Robert Speicher2016-06-271-1/+1
|\
| * Merge branch '19102-fix' into 'master' Robert Speicher2016-06-271-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix an information disclosure when requesting access to a group containing private projects Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19102. The commit speaks for itself: Fix an information disclosure when requesting access to a group containing private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. See merge request !1973
| | * Fix an information disclosure when requesting access to a group containing ↵Rémy Coutable2016-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Fix rendering of commit notesDouwe Maan2016-06-271-1/+8
|/ /
* | Merge branch 'issue_19096' into 'master' Stan Hu2016-06-251-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Validate presence of essential params for diff rendering ## What does this MR do? Check the presence of essential params before rendering diff content. ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? To avoid the generated application error ## What are the relevant issue numbers? #19096 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4917
| * | Validate presence of essential params for diff renderingissue_19096Ruben Davila2016-06-241-0/+7
| | | | | | | | | | | | | | | This will avoid application errors generated by the assumption of the presence of these params.
* | | Add specs and improve coffescript sortable binding functionissue_15588Felipe Artur2016-06-241-1/+2
| | |
* | | Fix issue being ordered twice and callback when moving between statesFelipe Artur2016-06-241-1/+1
| | |
* | | Fix a wrong MR status when merge_when_build_succeeds & ↵19035-fix-merge-issueRémy Coutable2016-06-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | project.only_allow_merge_if_build_succeeds are true The issue was that `MergeRequest#mergeable?` returns false when the CI state is not success and project.only_allow_merge_if_build_succeeds is true. In this case `Projects::MergeRequestsController#merge` would return the `:failed` status when enabling `merge_when_build_succeeds`, thus leading to a weird state and the MR never automatically merged. The fix is to disable the CI state check in the controller safeguard that early return the `:failed` status. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'fix/gitlab-import-project-file-fix' into 'master' Rémy Coutable2016-06-241-1/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix temp file being deleted after the request while importing a GitLab project Fixes https://gitlab.com/gitlab-com/infrastructure/issues/151 In production, the temporary uploaded file is getting deleted straight after the request so the Sidekiq worker is unable to find it in `/tmp` Also, improved erroring/logging of this situation. See merge request !4894
| * | | fix paramsJames Lopez2016-06-241-2/+2
| | | |
| * | | Fix tmp file being deleted after the request plus some cleanup and improved ↵James Lopez2016-06-241-1/+5
| | |/ | |/| | | | | | | erroring for this situation
* | | Support for rendering/redacting multiple documentsYorick Peterse2016-06-243-3/+39
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way certain documents are rendered (currently only Notes) and how documents are redacted. Previously both rendering and redacting would run on a per document basis. The result of this was that for every document we'd have to run countless queries just to figure out if we could display a set of links or not. This commit changes things around so that redacting Markdown documents is no longer tied into the html-pipeline Gem. This in turn allows it to redact multiple documents in a single pass, thus reducing the number of queries needed. In turn rendering issue/merge request notes has been adjusted to take advantage of this new setup. Instead of rendering Markdown somewhere deep down in a view the Markdown is rendered and redacted in the controller (taking the current user and all that into account). This has been done in such a way that the "markdown()" helper method can still be used on its own. This particular commit also paves the way for caching rendered HTML on object level. Right now there's an accessor method Note#note_html which is used for setting/getting the rendered HTML. Once we cache HTML on row level we can simply change this field to be a column and call a "save" whenever needed and we're pretty much done.
* | Merge branch 'zj-pipeline-can-be-nil'Douwe Maan2016-06-231-2/+7
|\ \ | |/ |/|
| * Check if pipeline is nil before mergingzj-pipeline-can-be-nilZ.J. van de Weg2016-06-231-2/+7
| |
* | Preload notes/discussions associations (award_emoji: :user)optimize-award-emojiPaco Guzman2016-06-231-2/+2
|/
* Merge branch ↵Douwe Maan2016-06-224-37/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '18755-fix-destroy-project-causes-post_decline_request-to-be-executed' into 'master' Resolve "Destroying a project causes post_decline_request to be executed" ## What does this MR do? Ensure we don't send "access request declined" to access requesters when a project is deleted. ## Are there points in the code the reviewer needs to double check? I've created a service to decouple the notification sending from the AR model. ## Why was this MR needed? Because there was an issue. ## What are the relevant issue numbers? Fixes #18755, #18750. ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG needed. - [x] Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4744
| * Raise a new Gitlab::Access::AccessDeniedError when permission is not enough ↵Rémy Coutable2016-06-184-38/+12
| | | | | | | | | | | | | | | | to destroy a member This is a try for a new approach to put the access checks at the service level. Signed-off-by: Rémy Coutable <remy@rymai.me>
| * Redirect to the member's source on request withdrawalRémy Coutable2016-06-181-1/+2
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * Use the new Members::DestroyService in group/project member controllersRémy Coutable2016-06-182-2/+2
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * New Members::DestroyServiceRémy Coutable2016-06-181-2/+4
| | | | | | | | | | | | | | This is to ensure we don't send unwanted notifications when deleting a project. In other words, stop abusing AR callbacks and use services. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'dz-fix-appearance-preview' into 'master' Jacob Schatz2016-06-211-0/+1
|\ \ | | | | | | | | | | | | | | | | | | Fix admin appearance settings preview Render appearance settings preview in devise layout instead of implementing it 2 times. See merge request !4792
| * | Fix admin appearance settings previewdz-fix-appearance-previewDmitriy Zaporozhets2016-06-201-0/+1
| |/ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Rename commit_data in Pipeline to commitfix/builds-api-nil-commitGrzegorz Bizon2016-06-211-1/+1
| |
* | Merge branch 'feature/runner-lock-on-project' into 'master' Rémy Coutable2016-06-213-11/+11
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to lock runner on a specific project Make it possible to lock runner on a specific project. ![Screen_Shot_2016-06-20_at_4.03.08_PM](/uploads/186378643a20106ff0b67b6fd8bd7f28/Screen_Shot_2016-06-20_at_4.03.08_PM.png) ---- ![Screen_Shot_2016-06-20_at_9.54.52_PM](/uploads/c479abdffaf19f383bb6b5a42bdd6cc3/Screen_Shot_2016-06-20_at_9.54.52_PM.png) ---- ![Screen_Shot_2016-06-20_at_9.56.26_PM](/uploads/6ad838679b0c28a1fe2e20e9224387ea/Screen_Shot_2016-06-20_at_9.56.26_PM.png) Closes #3407 See merge request !4093
| * \ Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-06-2012-91/+209
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/runner-lock-on-project * upstream/master: (353 commits) Put some admin settings in dropdown Add styleguide on configuration settings documentation Remove Duplicated keys add UNIQUE index to fingerprint Avoid autoload issue such as 'Mail::Parsers::AddressStruct' Move appearance settings as sub tab to application settings use rails root join fixed a couple of errors spotted in production Fix RangeError exceptions when referring to issues or merge requests outside of max database values Fix bug in `WikiLinkFilter`. Grammar and typographic changes to artifacts documentation Tweak grammar Small frontend code fixes and restore 8a2d88f commit Warn about admin privilege to disable GitHub Webhooks Listing GH Webhooks doesn't stop import process for non GH admin users fixup! updated docs for api endpoint award emoji Update CHANGELOG Ensure Todos counters doesn't count Todos for projects pending delete Add endpoints for award emoji on notes Sort API endpoints and implement feedback Add endpoints for Award Emoji ...
| * | Rename according to:Lin Jen-Shin2016-06-201-3/+3
| | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12563922 For clarification and consistency
| * | Admin::RunnerProjectsController#index is not usedremove-admin-runner-projectsLin Jen-Shin2016-06-171-5/+0
| | |
| * | Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-06-1714-55/+195
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/runner-lock-on-project * upstream/master: (337 commits) Update CHANGELOG for !4659 Center the header logo for all Devise emails Add previews for all customized Devise emails Customize the Devise `unlock_instructions` email Customize the Devise `reset_password_instructions` email Customize the Devise `password_change` emails Use gitlab-git 10.2.0 Use Git cached counters on project show page Fix indentation scss-lint errors Added title attribute to enties in tree view Closes #18353 Banzai::Filter::ExternalLinkFilter use XPath Reduce queries in IssueReferenceFilter Use gitlab_git 10.1.4 Fixed ordering in Project.find_with_namespace Fix images in emails Banzai::Filter::UploadLinkFilter use XPath Turn Group#owners into a has_many association Make project_id nullable CHANGELOG [ci skip] CHANGELOG [ci skip] ...
| * | | Fix typo. It's ivar and the column was called lockedLin Jen-Shin2016-06-161-1/+1
| | | | | | | | | | | | | | | | Again! For admin.
| * | | Fix typo. It's ivar and the column was called lockedLin Jen-Shin2016-06-151-1/+1
| | | |
| * | | Return the association and check it in controller instead:Lin Jen-Shin2016-06-142-2/+5
| | | | | | | | | | | | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4641#note_12444891
| * | | Merge branch 'master' into feature/runner-lock-on-projectLin Jen-Shin2016-06-1411-25/+29
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (147 commits) Update CHANGELOG Remove deprecated issues_tracker and issues_tracker_id from project Schema doesn’t reflect the changes of the last 3 migrations Revert CHANGELOG Also rename "find" in the specs Change to new Notes styleguide Add guide on changing a document's location Change logs.md location in README Move logs/logs.md to administration/logs.md Make "four phase test" Only show branches for revert / cherry-pick Instrument all Banzai::ReferenceParser classes Removed old comment from update_column_in_batches Update columns in batches until no rows are left Remove counters from Pipeline navigation Handle NULL migration errors in migration helpers Fix typo causing related branches to Error 500 Improved SVG sanitizer specs to include smoke tests for clean. Refactored SVG sanitizer Added SVG sanitizer fix to the changelog ...
| * | | | Avoid enabling locked runners. Give 403 in this caseLin Jen-Shin2016-06-142-0/+3
| | | | |
| * | | | Rename specific_for to available_for:Lin Jen-Shin2016-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Feedback from: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12413950
| * | | | Introduced Ci::Runner.specific_for for getting specific runners:Lin Jen-Shin2016-06-091-2/+1
| | | | | | | | | | | | | | | | | | | | for a particular project.
* | | | | Provide default branch/file path for ProjectsController#show18709-reduce-git-callsPaco Guzman2016-06-201-1/+7
| | | | |
* | | | | Unify check branch name existPaco Guzman2016-06-201-1/+1
| | | | |
* | | | | Fixed issue with returning ref in commits JSONasync-refs-dropdownPhil Hughes2016-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | Added tests to project controller
* | | | | Fixed Ruby to use excludePhil Hughes2016-06-181-1/+1
| | | | |
* | | | | Correctly adds commit ID into dropdownPhil Hughes2016-06-181-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Removes un-used method Fixes other Ruby issues
* | | | | Pulls back tags if any existPhil Hughes2016-06-181-2/+6
| | | | |
* | | | | Tests fix for ref switcherPhil Hughes2016-06-181-1/+1
| | | | |
* | | | | Refs dropdown is now loaded asyncPhil Hughes2016-06-181-0/+16
| |_|_|/ |/| | |
* | | | Merge branch 'issue_12758' into 'master' Douwe Maan2016-06-174-47/+39
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement custom notification level options ![Screen_Shot_2016-06-17_at_15.31.43](/uploads/3fc47d2f461b3e8b67bb8acaa304cf99/Screen_Shot_2016-06-17_at_15.31.43.png) ![Screenshot_from_2016-06-15_10-52-27](/uploads/88dbdd21d97e80ee772fe08fa0c9b393/Screenshot_from_2016-06-15_10-52-27.png) part of #12758 See merge request !4389
| * \ \ \ Merge master into issue_12758issue_12758Felipe Artur2016-06-176-26/+69
| |\ \ \ \
| * | | | | Allow users to set custom notifications in projects they don't own and ↵Felipe Artur2016-06-171-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | several fixes to code
| * | | | | Re-use notifications dropdown/modal for user profileFelipe Artur2016-06-174-52/+37
| |\ \ \ \ \
| | * | | | | Re-use notifications dropdown on user profileFelipe Artur2016-06-164-52/+37
| | | | | | |
| | * | | | | Refactor custom notifications controller code and add specsFelipe Artur2016-06-141-14/+5
| | | | | | |