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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
224c0103
Commit
224c0103
authored
May 10, 2019
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor RoutableActions to allow for additional checks
parent
0f6500d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
app/controllers/concerns/routable_actions.rb
app/controllers/concerns/routable_actions.rb
+9
-3
No files found.
app/controllers/concerns/routable_actions.rb
View file @
224c0103
...
@@ -9,9 +9,7 @@ module RoutableActions
...
@@ -9,9 +9,7 @@ module RoutableActions
ensure_canonical_path
(
routable
,
requested_full_path
)
ensure_canonical_path
(
routable
,
requested_full_path
)
routable
routable
else
else
if
not_found_or_authorized_proc
perform_not_found_actions
(
routable
,
[
not_found_or_authorized_proc
])
not_found_or_authorized_proc
.
call
(
routable
)
end
route_not_found
unless
performed?
route_not_found
unless
performed?
...
@@ -19,6 +17,14 @@ module RoutableActions
...
@@ -19,6 +17,14 @@ module RoutableActions
end
end
end
end
def
perform_not_found_actions
(
routable
,
actions
)
actions
.
compact
.
each
do
|
action
|
break
if
performed?
action
.
call
(
routable
)
end
end
def
routable_authorized?
(
routable
,
extra_authorization_proc
)
def
routable_authorized?
(
routable
,
extra_authorization_proc
)
return
false
unless
routable
return
false
unless
routable
...
...
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