Commit Graph
132 Commits
Author SHA1 Message Date
Yorick Peterse 53719ecb80 Handle permissions for ExternalIssue instances
This fixes the remainder of the GitPushService specs.
2016-03-09 17:10:43 +01:00
Robert Speicher e6204eb3cb Move update_merge_request ability to Developer
Closes #13663
2016-03-04 15:53:25 -05:00
Kamil Trzcinski a7c441aa17 Use delete instead of assignment operator when filtering build abilities 2016-02-04 16:32:41 +01:00
Kamil Trzcinski c64c106091 Update ability model after comments 2016-02-04 14:43:52 +01:00
Kamil Trzcinski b4c36130cc Rename allow_guest_to_access_builds to public_builds 2016-02-04 12:57:46 +01:00
Kamil Trzcinski 5f7be11aa6 Simplify abilities 2016-02-04 11:09:42 +01:00
Kamil Trzcinski c3d897a9a3 Properly handle commit status permissions (for a build) 2016-02-03 13:33:47 +01:00
Kamil Trzcinski e80c79e3ad Fix build errors 2016-02-03 12:41:16 +01:00
Kamil Trzcinski 627909c2a4 Add CI setting: allow_guest_to_access_builds
Add the `read_build` ability if user is anonymous or guest and allow_guest_to_access_builds is enabled.
2016-02-02 17:59:37 +01:00
Kamil Trzcinski 055afab5c7 Make the CI permission model simpler
This MR simplifies CI permission model:
- read_build: allows to read a list of builds, artifacts and trace
- update_build: allows to cancel and retry builds
- create_build: allows to create builds from gitlab-ci.yml (not yet implemented)
- admin_build: allows to manage triggers, runners and variables
- read_commit_status: allows to read a list of commit statuses (including the overall of builds)
- create_commit_status: allows to create a new commit status using API

Remove all extra methods to manage permission.
Made all controllers to use explicitly the new permissions.
2016-02-02 09:18:08 +01:00
Andrew JohnsonandGrzegorz Bizon f66f9e95bf Give reporters the ability to download artifacts.
Also fix a few places where page_404 should be render_404.
2016-01-15 12:01:19 +01:00
Grzegorz Bizon 487b0a026f Improvements, readability for artifacts browser 2016-01-14 12:48:16 +01:00
Valery Sizov 8b18449125 remove public field from namespace and refactoring 2016-01-04 16:00:29 +02:00
Jason Lee 03a40a7ee1 Avoid allocations in Ability class.
It won't change anything after they are first invoke, so add method cache to avoid allocations and avoid GC.

Benchmarks:

```
Calculating -------------------------------------
project_guest_rules without method cache
                        79.352k i/100ms
project_guest_rules with method cache
                        93.634k i/100ms
-------------------------------------------------
project_guest_rules without method cache
                          2.865M (±32.5%) i/s -     11.982M
project_guest_rules with method cache
                          4.419M (± 7.4%) i/s -     22.004M

Comparison:
project_guest_rules with method cache:  4418908.0 i/s
project_guest_rules without method cache:  2864514.0 i/s - 1.54x slower

Calculating -------------------------------------
project_report_rules without method cache
                        53.126k i/100ms
project_report_rules with method cache
                        97.473k i/100ms
-------------------------------------------------
project_report_rules without method cache
                          1.093M (±36.5%) i/s -      4.675M
project_report_rules with method cache
                          4.420M (± 7.2%) i/s -     22.029M
Comparison:
project_report_rules with method cache:  4420054.3 i/s
project_report_rules without method cache:  1092509.6 i/s - 4.05x slower
```

https://gist.github.com/huacnlee/b04788ae6df42fe769e4
2015-12-16 11:51:37 +08:00
Douglas Barbosa Alexandre 67cc6b0642 Signed in admin should be able to add/remove himself to a project 2015-12-01 20:53:43 -02:00
Douglas Barbosa Alexandre 9ab7bdf773 Signed in admin should be able to add/remove himself to a group 2015-12-01 20:53:43 -02:00
Robert Speicher 56476f1847 Merge branch 'dbalexandre/gitlab-ce-fix-personal-snippet-access-workflow' into 'master'
Improve personal snippet access workflow.

Replaces !1709

Fixes #3258

See merge request !1817
2015-11-19 17:22:20 +00:00
Robert Speicher 08dc38223e Rename not_auth_* ability methods to anonymous_* 2015-11-17 15:00:14 -05:00
Douwe Maan 756d61562b Minor refactoring 2015-11-17 16:24:02 +01:00
Douwe Maan 16438ad205 Merge branch 'master' into dbalexandre/gitlab-ce-fix-personal-snippet-access-workflow 2015-11-17 16:19:16 +01:00
Douwe Maan ecb83afabc Refactor ability changes 2015-11-17 15:49:37 +01:00
Douwe Maan e849b51cae Merge branch 'master' into james11/gitlab-ce-removable-group-owner 2015-11-17 15:40:54 +01:00
Dmitriy Zaporozhets 929ab909c8 Group masters should be able to create/close milestones
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 16:14:19 +01:00
James Lopez 77dd561796 fixing rubocop indents 2015-11-12 08:43:30 +00:00
James Lopez c6a0f109cd refactored code as projects only have one owner. Kept some refactoring in place (has_owners concern) 2015-11-11 15:42:27 +00:00
Kamil Trzcinski d0e3e823a2 Implement Build Artifacts
- Offloads uploading to GitLab Workhorse
- Use /authorize request for fast uploading
- Added backup recipes for artifacts
- Support download acceleration using X-Sendfile
2015-11-10 12:51:50 +01:00
James Lopez 1b14bc5957 refactored permissions and added update_project_member ability logic. Also refactored owner methods to a concern. 2015-11-03 11:11:56 +00:00
Douglas Barbosa Alexandre 091979bd1b Fix ability name for public or internal personal snippets 2015-11-02 14:04:45 -02:00
Douglas Barbosa Alexandre c8fe421512 Improve personal snippet access workflow. Fixes #3258 2015-10-29 18:42:29 -02:00
Han Loong Liauw 02e8beaa0b Merge branch 'master' into remove-forks-from-projects-settings 2015-10-17 09:32:31 +11:00
Kamil Trzcinski a957eca6f3 Added builds view 2015-10-14 17:28:38 +02:00
Han Loong Liauw df99ddbba1 Adds ability to remove the forked relationship
This was previously possible through the API but can now be done
through the project#edit settings screen if the current user is
the owner of the project.
Update changelog
2015-10-13 21:42:17 +11:00
Kamil Trzcinski 914cfbd2f1 Implement Commit Status API 2015-10-12 11:53:49 +02:00
Valery Sizov 44261a5d9f integration with gitlab auth 2015-09-09 17:36:01 +03:00
Douwe Maan f9bcb9632c Add specific ability for managing group members 2015-07-28 16:32:15 +02:00
Robert Speicher 31dc5e7034 Add admin_merge_request ability to Developer level and up
This was necessary because this permission is checked dynamically by
`app/views/shared/issuable/_context` when on a Merge Request.

Closes #2058
2015-07-24 14:57:38 -04:00
Stan Hu 996ad35bed Merge branch 'fix-disabled-feature-access' into 'master'
Fix (i.e. prevent) access to disabled features for unauthenticated users

Unauthenticated users had access to disabled features of public
projects. The code has been slightly refactored so that feature checks
are done in a separate method and can also be applied for public access.

See merge request !1006
2015-07-20 16:42:07 +00:00
Daniel Gerhardt 4a0e4c857f Fix access to disabled features for unauthenticated users
Unauthenticated users had access to disabled features of public
projects. The code has been slightly refactored so that feature checks
are done in a separate method and can also be applied for public access.
2015-07-20 09:45:24 +02:00
Daniel Gerhardt 69417d36b2 Fix label read access for unauthenticated users
The label page was added to navigation for unauthorized users because
the previously used milestone read permission was still checked. This
has been fixed and read access to labels is now granted (again) for
public projects.

This regression has been introduced in
07efb17e10 (7.12).

See also 9bcd36396b.

Refs !836, !842.
2015-07-19 21:33:21 +02:00
Dmitriy Zaporozhets a5b54f919a Reporter role can manage issue tracker now
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-30 13:33:02 +02:00
Dmitriy Zaporozhets 7ca017b513 Refactor issue, mr, note abilities to include project abilities too
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 18:15:36 +02:00
Dmitriy Zaporozhets 083d4604c4 Change dynamic abilities to new format
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 17:18:40 +02:00
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
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
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
Stan Hu ab88b7da19 Fix project snippets button appearing when it is disabled
Closes #1705
2015-05-27 05:07:44 -07:00
Stan Hu 9bcd36396b Refactor permission checks to use can? instead of issues_enabled and merge_requests_enabled 2015-05-25 16:51:04 -07:00
Stan Hu a7d8a7bd3d Disable "New Issue" and "New Merge Request" buttons when features are disabled in project settings
Closes #1676
2015-05-25 06:16:33 -04:00