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
bbc916ba
Commit
bbc916ba
authored
Aug 27, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If user is owner of project it cant be removed from this project
parent
9fbbd6a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
app/models/users_project.rb
app/models/users_project.rb
+4
-0
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+6
-3
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+6
-3
No files found.
app/models/users_project.rb
View file @
bbc916ba
...
...
@@ -110,4 +110,8 @@ class UsersProject < ActiveRecord::Base
def
access_field
project_access
end
def
owner?
project
.
owner
==
user
end
end
app/views/admin/projects/show.html.haml
View file @
bbc916ba
...
...
@@ -102,6 +102,9 @@
%strong
=
link_to
user
.
name
,
admin_user_path
(
user
)
.pull-right
%span
.light
=
users_project
.
human_access
=
link_to
admin_project_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
-
if
users_project
.
owner?
%span
.light
Owner
-
else
%span
.light
=
users_project
.
human_access
=
link_to
admin_project_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
app/views/admin/users/show.html.haml
View file @
bbc916ba
...
...
@@ -90,6 +90,9 @@
-
if
tm
.pull-right
%span
.light
=
tm
.
human_access
=
link_to
admin_project_member_path
(
project
,
tm
.
user
),
confirm:
remove_from_project_team_message
(
project
,
@user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
-
if
tm
.
owner?
%span
.light
Owner
-
else
%span
.light
=
tm
.
human_access
=
link_to
admin_project_member_path
(
project
,
tm
.
user
),
confirm:
remove_from_project_team_message
(
project
,
@user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
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