Sha256: 1212cf27a81707b0174e4798b684c289f0366aaf25133b11f44d6d583794c521

Contents?: true

Size: 583 Bytes

Versions: 141

Compression:

Stored size: 583 Bytes

Contents

view_permission = Permission.where(:name => :view_foreman_tasks, :resource_type => ForemanTasks::Task.name).first

# the anonymous role was renamed to default in
# https://github.com/theforeman/foreman/pull/3239
default_role = Role.respond_to?(:default) ? Role.default : Role.anonymous
# the view_permissions can be nil in tests: skipping in that case
if view_permission && !default_role.permissions.include?(view_permission)
  default_role.filters.create(:search => 'owner.id = current_user') do |filter|
    filter.filterings.build { |f| f.permission = view_permission }
  end
end

Version data entries

141 entries across 141 versions & 1 rubygems

Version Path
foreman-tasks-10.0.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-10.0.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.2.3 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.2.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.2.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.2.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.1.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.0.4 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.1.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.0.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.0.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.3.3 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-9.0.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.2.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.1.4 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.3.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.3.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.1.3 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.3.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.2.0 db/seeds.d/20-foreman_tasks_permissions.rb