Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
585602a1
Commit
585602a1
authored
Jan 26, 2021
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace authorized_resource? with authorize method
parent
c9c83537
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
app/graphql/mutations/jira_import/import_users.rb
app/graphql/mutations/jira_import/import_users.rb
+2
-6
app/graphql/mutations/jira_import/start.rb
app/graphql/mutations/jira_import/start.rb
+2
-6
No files found.
app/graphql/mutations/jira_import/import_users.rb
View file @
585602a1
...
@@ -7,6 +7,8 @@ module Mutations
...
@@ -7,6 +7,8 @@ module Mutations
graphql_name
'JiraImportUsers'
graphql_name
'JiraImportUsers'
authorize
:admin_project
field
:jira_users
,
field
:jira_users
,
[
Types
::
JiraUserType
],
[
Types
::
JiraUserType
],
null:
true
,
null:
true
,
...
@@ -29,12 +31,6 @@ module Mutations
...
@@ -29,12 +31,6 @@ module Mutations
errors:
service_response
.
errors
errors:
service_response
.
errors
}
}
end
end
private
def
authorized_resource?
(
project
)
Ability
.
allowed?
(
context
[
:current_user
],
:admin_project
,
project
)
end
end
end
end
end
end
end
app/graphql/mutations/jira_import/start.rb
View file @
585602a1
...
@@ -7,6 +7,8 @@ module Mutations
...
@@ -7,6 +7,8 @@ module Mutations
graphql_name
'JiraImportStart'
graphql_name
'JiraImportStart'
authorize
:admin_project
field
:jira_import
,
field
:jira_import
,
Types
::
JiraImportType
,
Types
::
JiraImportType
,
null:
true
,
null:
true
,
...
@@ -40,12 +42,6 @@ module Mutations
...
@@ -40,12 +42,6 @@ module Mutations
errors:
service_response
.
errors
errors:
service_response
.
errors
}
}
end
end
private
def
authorized_resource?
(
project
)
Ability
.
allowed?
(
context
[
:current_user
],
:admin_project
,
project
)
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment