mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-28 02:27:57 +08:00
Add inherit information to access modal [SCI-7882]
This commit is contained in:
parent
193ff7bc46
commit
a679e0ea62
3 changed files with 11 additions and 6 deletions
|
@ -28,6 +28,10 @@
|
|||
.user-assignment-controls {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
|
||||
.text-muted {
|
||||
color: $color-silver-chalice;
|
||||
}
|
||||
}
|
||||
|
||||
.user-assignment-controls {
|
||||
|
|
|
@ -12,15 +12,14 @@ module UserAssignmentsHelper
|
|||
|
||||
def user_assignment_resource_role_name(user, resource, inherit = '')
|
||||
user_assignment = resource.user_assignments.find_by(user: user)
|
||||
if ![Project, Protocol].include?(resource.class) && user_assignment.automatically_assigned?
|
||||
|
||||
return '' if [Project, Protocol].include?(resource.class) && inherit.blank?
|
||||
|
||||
if user_assignment.automatically_assigned?
|
||||
parent = resource.permission_parent
|
||||
return user_assignment_resource_role_name(user, parent, '_inherit')
|
||||
end
|
||||
|
||||
"#{user_assignment.user_role.name}
|
||||
<span class='permission-object-tag'
|
||||
title='#{t("access_permissions.partials.#{resource.class.to_s.downcase}_tooltip#{inherit}")}'>
|
||||
#{t("access_permissions.partials.#{resource.class.to_s.downcase}")}
|
||||
</span>".html_safe
|
||||
t("access_permissions.partials.#{resource.class.to_s.downcase}_tooltip#{inherit}")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
</div>
|
||||
<div>
|
||||
<%= current_assignee_name(user) %>
|
||||
<br>
|
||||
<small class="text-muted"><%= user_assignment_resource_role_name(user, object) %></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-assignment-controls">
|
||||
|
|
Loading…
Reference in a new issue