mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 19:16:39 +10:00
Handle permissions for ExternalIssue instances
This fixes the remainder of the GitPushService specs.
This commit is contained in:
@@ -9,6 +9,7 @@ class Ability
|
||||
when CommitStatus then commit_status_abilities(user, subject)
|
||||
when Project then project_abilities(user, subject)
|
||||
when Issue then issue_abilities(user, subject)
|
||||
when ExternalIssue then external_issue_abilities(user, subject)
|
||||
when Note then note_abilities(user, subject)
|
||||
when ProjectSnippet then project_snippet_abilities(user, subject)
|
||||
when PersonalSnippet then personal_snippet_abilities(user, subject)
|
||||
@@ -424,6 +425,10 @@ class Ability
|
||||
end
|
||||
end
|
||||
|
||||
def external_issue_abilities(user, subject)
|
||||
project_abilities(user, subject.project)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def named_abilities(name)
|
||||
|
||||
@@ -367,7 +367,7 @@ describe GitPushService, services: true do
|
||||
}
|
||||
}.to_json
|
||||
|
||||
execute_service(project, user, @oldrev, @newrev, @ref )
|
||||
execute_service(project, commit_author, @oldrev, @newrev, @ref )
|
||||
expect(WebMock).to have_requested(:post, jira_api_transition_url).with(
|
||||
body: transition_body
|
||||
).once
|
||||
@@ -378,7 +378,7 @@ describe GitPushService, services: true do
|
||||
body: "Issue solved with [#{closing_commit.id}|http://localhost/#{project.path_with_namespace}/commit/#{closing_commit.id}]."
|
||||
}.to_json
|
||||
|
||||
execute_service(project, user, @oldrev, @newrev, @ref )
|
||||
execute_service(project, commit_author, @oldrev, @newrev, @ref )
|
||||
expect(WebMock).to have_requested(:post, jira_api_comment_url).with(
|
||||
body: comment_body
|
||||
).once
|
||||
|
||||
Reference in New Issue
Block a user