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
Tatuya Kamada
gitlab-ce
Commits
c1de46db
Commit
c1de46db
authored
Sep 10, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project pages for authorized user
parent
4e7b47dd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
7 deletions
+12
-7
app/assets/stylesheets/ci/application.scss
app/assets/stylesheets/ci/application.scss
+4
-0
app/controllers/ci/application_controller.rb
app/controllers/ci/application_controller.rb
+2
-3
app/controllers/ci/runners_controller.rb
app/controllers/ci/runners_controller.rb
+3
-1
app/views/ci/builds/show.html.haml
app/views/ci/builds/show.html.haml
+2
-2
app/views/layouts/ci/project.html.haml
app/views/layouts/ci/project.html.haml
+1
-1
No files found.
app/assets/stylesheets/ci/application.scss
View file @
c1de46db
...
...
@@ -52,4 +52,8 @@ $nprogress-color: #9BC;
body
{
padding-top
:
0
!
important
;
a
{
color
:
#3084bb
;
}
}
app/controllers/ci/application_controller.rb
View file @
c1de46db
...
...
@@ -8,7 +8,6 @@ module Ci
rescue_from
Ci
::
Network
::
UnauthorizedError
,
with: :invalid_token
before_filter
:default_headers
#before_filter :check_config
helper_method
:gl_project
protect_from_forgery
...
...
@@ -38,7 +37,7 @@ module Ci
end
def
authorize_manage_builds!
unless
can?
(
current_user
,
:
manage_builds
,
gl_project
)
unless
can?
(
current_user
,
:
admin_project
,
gl_project
)
return
page_404
end
end
...
...
@@ -48,7 +47,7 @@ module Ci
end
def
authorize_manage_project!
unless
can?
(
current_user
,
:
manage
_project
,
gl_project
)
unless
can?
(
current_user
,
:
admin
_project
,
gl_project
)
return
page_404
end
end
...
...
app/controllers/ci/runners_controller.rb
View file @
c1de46db
...
...
@@ -10,7 +10,9 @@ module Ci
def
index
@runners
=
@project
.
runners
.
order
(
'id DESC'
)
@specific_runners
=
current_user
.
authorized_runners
.
@specific_runners
=
Ci
::
Runner
.
specific
.
includes
(
:runner_projects
).
where
(
Ci
::
RunnerProject
.
table_name
=>
{
project_id:
current_user
.
authorized_projects
}
).
where
.
not
(
id:
@runners
).
order
(
"
#{
Ci
::
Runner
.
table_name
}
.id DESC"
).
page
(
params
[
:page
]).
per
(
20
)
@shared_runners
=
Ci
::
Runner
.
shared
.
active
@shared_runners_count
=
@shared_runners
.
count
(
:all
)
...
...
app/views/ci/builds/show.html.haml
View file @
c1de46db
...
...
@@ -104,7 +104,7 @@
#{
time_ago_in_words
(
@build
.
finished_at
)
}
ago
%p
%span
.attr-name
Runner:
-
if
@build
.
runner
&&
current_user
&&
current_user
.
is_
admin
-
if
@build
.
runner
&&
current_user
&&
current_user
.
admin
\
#{
link_to
"##{@build.runner.id}"
,
ci_admin_runner_path
(
@build
.
runner
.
id
)
}
-
elsif
@build
.
runner
\##{@build.runner.id}
...
...
app/views/layouts/ci/project.html.haml
View file @
c1de46db
...
...
@@ -17,7 +17,7 @@
%hr
.container.container-body
.content
-
if
current_user
&&
can?
(
current_user
,
:
manage
_project
,
gl_project
)
-
if
current_user
&&
can?
(
current_user
,
:
admin
_project
,
gl_project
)
.row
.col-md-2.append-bottom-20
=
render
'layouts/ci/nav_project'
...
...
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