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
cc0295b7
Commit
cc0295b7
authored
Dec 05, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only owner can remove project
parent
6ea6ab7c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
5 deletions
+13
-5
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+4
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-0
app/views/help/permissions.html.haml
app/views/help/permissions.html.haml
+1
-0
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+4
-3
app/views/services/_gitlab_ci.html.haml
app/views/services/_gitlab_ci.html.haml
+1
-1
app/views/services/index.html.haml
app/views/services/index.html.haml
+1
-1
No files found.
app/controllers/application_controller.rb
View file @
cc0295b7
...
@@ -112,6 +112,10 @@ class ApplicationController < ActionController::Base
...
@@ -112,6 +112,10 @@ class ApplicationController < ActionController::Base
render
file:
Rails
.
root
.
join
(
"public"
,
"404"
),
layout:
false
,
status:
"404"
render
file:
Rails
.
root
.
join
(
"public"
,
"404"
),
layout:
false
,
status:
"404"
end
end
def
render_403
render
file:
Rails
.
root
.
join
(
"public"
,
"403"
),
layout:
false
,
status:
"403"
end
def
require_non_empty_project
def
require_non_empty_project
redirect_to
@project
if
@project
.
empty_repo?
redirect_to
@project
if
@project
.
empty_repo?
end
end
...
...
app/controllers/projects_controller.rb
View file @
cc0295b7
...
@@ -89,6 +89,8 @@ class ProjectsController < ProjectResourceController
...
@@ -89,6 +89,8 @@ class ProjectsController < ProjectResourceController
end
end
def
destroy
def
destroy
return
access_denied!
unless
can?
(
current_user
,
:remove_project
,
project
)
# Disable the UsersProject update_repository call, otherwise it will be
# Disable the UsersProject update_repository call, otherwise it will be
# called once for every person removed from the project
# called once for every person removed from the project
UsersProject
.
skip_callback
(
:destroy
,
:after
,
:update_repository
)
UsersProject
.
skip_callback
(
:destroy
,
:after
,
:update_repository
)
...
...
app/views/help/permissions.html.haml
View file @
cc0295b7
...
@@ -66,3 +66,4 @@
...
@@ -66,3 +66,4 @@
%legend
Owner
%legend
Owner
%ul
%ul
%li
Transfer project to another namespace
%li
Transfer project to another namespace
%li
Remove project
app/views/projects/_form.html.haml
View file @
cc0295b7
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
%span
.cred
Be careful. Changing project namespace can have unintended side effects
%span
.cred
Be careful. Changing project namespace can have unintended side effects
-
else
-
else
%a
.btn.
btn-small.
disabled
=
@project
.
namespace
.
try
(
:human_name
)
||
"/"
%a
.btn.disabled
=
@project
.
namespace
.
try
(
:human_name
)
||
"/"
%span
.cred
Only owner can change project namespace.
%span
.cred
Only owner can change project namespace.
...
@@ -69,5 +69,6 @@
...
@@ -69,5 +69,6 @@
=
f
.
submit
'Save'
,
class:
"btn save-btn"
=
f
.
submit
'Save'
,
class:
"btn save-btn"
=
link_to
'Cancel'
,
@project
,
class:
"btn"
=
link_to
'Cancel'
,
@project
,
class:
"btn"
-
unless
@project
.
new_record?
-
unless
@project
.
new_record?
.right
-
if
can?
(
current_user
,
:remove_project
,
@project
)
=
link_to
'Remove'
,
@project
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn danger"
.right
=
link_to
'Remove'
,
@project
,
confirm:
'Removed project can not be restored! Are you sure?'
,
method: :delete
,
class:
"btn danger"
app/views/services/_gitlab_ci.html.haml
View file @
cc0295b7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
-
if
@service
.
active
-
if
@service
.
active
%small
.cgreen
Enabled
%small
.cgreen
Enabled
-
else
-
else
%small
.
btn
Disabled
%small
.
cgray
Disabled
...
...
app/views/services/index.html.haml
View file @
cc0295b7
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
-
if
@gitlab_ci_service
.
active
-
if
@gitlab_ci_service
.
active
%small
.cgreen
Enabled
%small
.cgreen
Enabled
-
else
-
else
%small
.
btn
Disabled
%small
.
cgray
Disabled
%li
.wll
%li
.wll
%h4
%h4
Jenkins CI
Jenkins CI
...
...
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