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
Jérome Perrin
gitlab-ce
Commits
237ddd60
Commit
237ddd60
authored
Jan 24, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve authorization for new/edit blob pages
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
4645f464
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
1 deletion
+4
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-0
app/controllers/projects/edit_tree_controller.rb
app/controllers/projects/edit_tree_controller.rb
+1
-0
app/controllers/projects/new_tree_controller.rb
app/controllers/projects/new_tree_controller.rb
+1
-0
app/views/projects/tree/_tree.html.haml
app/views/projects/tree/_tree.html.haml
+1
-1
No files found.
app/controllers/projects/blob_controller.rb
View file @
237ddd60
...
...
@@ -6,6 +6,7 @@ class Projects::BlobController < Projects::ApplicationController
before_filter
:authorize_read_project!
before_filter
:authorize_code_access!
before_filter
:require_non_empty_project
before_filter
:authorize_push!
,
only:
[
:destroy
]
before_filter
:blob
...
...
app/controllers/projects/edit_tree_controller.rb
View file @
237ddd60
class
Projects::EditTreeController
<
Projects
::
BaseTreeController
before_filter
:require_branch_head
before_filter
:blob
before_filter
:authorize_push!
def
show
@last_commit
=
Gitlab
::
Git
::
Commit
.
last_for_path
(
@repository
,
@ref
,
@path
).
sha
...
...
app/controllers/projects/new_tree_controller.rb
View file @
237ddd60
class
Projects::NewTreeController
<
Projects
::
BaseTreeController
before_filter
:require_branch_head
before_filter
:authorize_push!
def
show
end
...
...
app/views/projects/tree/_tree.html.haml
View file @
237ddd60
...
...
@@ -9,7 +9,7 @@
=
link_to
truncate
(
title
,
length:
40
),
project_tree_path
(
@project
,
path
)
-
else
=
link_to
title
,
'#'
-
if
@repository
.
branch_names
.
include?
(
@ref
)
-
if
current_user
&&
@repository
.
branch_names
.
include?
(
@ref
)
&&
current_user
.
can?
(
:push_code
,
@project
)
%li
=
link_to
project_new_tree_path
(
@project
,
@id
),
title:
'New file'
,
id:
'new-file-link'
do
%small
...
...
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