Project

General

Profile

« Previous | Next » 

Revision acfbc458

Added by Marek Hulán about 10 years ago

fixes #812 - new permissions model, user group role and nest support, role filters for better granularity

Contributions from:

View differences:

app/views/hosts/_form.html.erb
<% if SETTINGS[:unattended] and @host.managed %>
<li><a href="#network" data-toggle="tab"><%= _('Network') %></a></li>
<li><a href="#os" data-toggle="tab"><%= _('Operating System') %></a></li>
<% if authorized_for("Compute::Resources::Vms", :create) %>
<% if authorized_for(:controller => "Compute::Resources::Vms", :action => :create) %>
<li id="compute_resource_tab" <%= display? !(@host.compute_resource_id || params[:host] && params[:host][:compute_resource_id].present?)%>><a href="#compute_resource" data-toggle="tab"><%= _('Virtual Machine') %></a></li>
<% end %>
<% end %>
......
<% if show_organization_tab? %>
<%= select_f f, :organization_id, Organization.my_organizations, :id, :to_label,
{ :include_blank => !@host.managed?, :selected => @organization.id},
{ :include_blank => !@host.managed?, :selected => @organization.try(:id)},
{ :disabled => !@host.new_record?,
:onchange => 'organization_changed(this);', :label => _("Organization"), :'data-host-id' => @host.id,
:'data-url' => process_taxonomy_hosts_path,
......
<% if show_location_tab? %>
<%= select_f f, :location_id, Location.my_locations, :id, :to_label,
{ :include_blank => !@host.managed?, :selected => @location.id },
{ :include_blank => !@host.managed?, :selected => @location.try(:id) },
{ :disabled => !@host.new_record?,
:onchange => 'location_changed(this);', :label => _("Location"), :"data-host-id" => @host.id,
:'data-url' => process_taxonomy_hosts_path, :selected => Location.my_locations,
......
:'data-url' => (@host.new_record? || @host.type_changed?) ? process_hostgroup_hosts_path : hostgroup_or_environment_selected_hosts_path,
:help_inline => :indicator } %>
<%= select_f f, :compute_resource_id, ComputeResource.my_compute_resources.with_taxonomy_scope_override(@location,@organization), :id, :to_label,
<%= select_f f, :compute_resource_id, ComputeResource.with_taxonomy_scope_override(@location,@organization).authorized(:view_compute_resources), :id, :to_label,
{ :include_blank => _('Bare Metal') },
{:label => _('Deploy on'), :disabled => !@host.new_record?, :'data-url' => compute_resource_selected_hosts_path,
:onchange => 'computeResourceSelected(this);',

Also available in: Unified diff