Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit d97c0f8

Browse files
committed
More fixes for OP v13.1.0
1 parent a0b293d commit d97c0f8

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Introducing OpenProject GitLab Integration v2.1.3 GA
1+
## Introducing OpenProject GitLab Integration v2.1.4 GA
22

33
Based on the OpenProject Github Integration, this plugin offers the same functionalities plus other new features. This is the first version that includes the visualization of the status of the *Pipelines* (by now, it is considered in Beta status). You can test it by activating the Pipelines event in the GitLab webhook. Just keep in mind that not all pipelines will be reflected in OpenProject, only Merge Request type pipelines (for more information see the GitLab issue https://gitlab.com/gitlab-org/gitlab/-/issues/345028). Any feedback about the pipelines feature would be very appreciated, whether it works or if issues arise (you can use this ticket https://github.com/btey/openproject-gitlab-integration/issues/43).
44

@@ -159,7 +159,7 @@ Add the following in **Gemfile.lock**:
159159
PATH
160160
remote: modules/gitlab_integration
161161
specs:
162-
openproject-gitlab_integration (2.1.2)
162+
openproject-gitlab_integration (2.1.4)
163163
openproject-webhooks
164164
```
165165

lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module V3
3434
module GitlabIssues
3535
class GitlabIssuesByWorkPackageAPI < ::API::OpenProjectAPI
3636
after_validation do
37-
authorize(:show_gitlab_content, context: @work_package.project)
37+
authorize_in_work_package(:show_gitlab_content, work_package: @work_package)
3838
@gitlab_issues = @work_package.gitlab_issues
3939
end
4040

lib/api/v3/gitlab_merge_requests/gitlab_merge_requests_by_work_package_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module V3
3434
module GitlabMergeRequests
3535
class GitlabMergeRequestsByWorkPackageAPI < ::API::OpenProjectAPI
3636
after_validation do
37-
authorize(:show_gitlab_content, context: @work_package.project)
37+
authorize_in_work_package(:show_gitlab_content, work_package: @work_package)
3838
@gitlab_merge_requests = @work_package.gitlab_merge_requests
3939
end
4040

lib/open_project/gitlab_integration/notification_handler/helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def find_visible_work_packages(ids, user)
7575
WorkPackage
7676
.includes(:project)
7777
.where(id: ids)
78-
.select { |wp| user.allowed_to?(:add_work_package_notes, wp.project) }
78+
.select { |wp| user.allowed_in_work_package?(:add_work_package_notes, wp) }
7979
end
8080

8181
# Returns a list of `WorkPackage`s that were referenced in the `text` and are visible to the given `user`.

lib/open_project/gitlab_integration/patches/api/work_package_representer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module WorkPackageRepresenter
3535
def extension
3636
->(*) do
3737
link :gitlab,
38-
cache_if: -> { current_user.allowed_to?(:show_gitlab_content, represented.project) } do
38+
cache_if: -> { current_user.allowed_in_work_package?(:show_gitlab_content, represented) } do
3939
next if represented.new_record?
4040

4141
{

openproject-gitlab_integration.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
Gem::Specification.new do |s|
3434
s.name = 'openproject-gitlab_integration'
35-
s.version = '2.1.3'
35+
s.version = '2.1.4'
3636
s.authors = 'Ben Tey'
3737
s.email = '[email protected]'
3838
s.homepage = 'https://github.com/btey/openproject-gitlab-integration'

0 commit comments

Comments
 (0)