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-8.1.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.1.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.1.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.0.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.0.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-8.0.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-7.2.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-7.1.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-7.2.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-7.1.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-6.0.3 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-7.0.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-6.0.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-4.1.6 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-5.2.3 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-6.0.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-5.2.2 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-6.0.0 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-5.2.1 db/seeds.d/20-foreman_tasks_permissions.rb
foreman-tasks-5.3.0 db/seeds.d/20-foreman_tasks_permissions.rb