If user is owner of project it cant be removed from this project
This commit is contained in:
parent
9fbbd6a68e
commit
bbc916baee
3 changed files with 16 additions and 6 deletions
|
@ -110,4 +110,8 @@ class UsersProject < ActiveRecord::Base
|
|||
def access_field
|
||||
project_access
|
||||
end
|
||||
|
||||
def owner?
|
||||
project.owner == user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue