foreman-tasks 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ view_permission = Permission.where(:name => :view_foreman_tasks, :resource_type => ForemanTasks::Task.name).first
2
+
3
+ # the view_permissions can be nil in tests: skipping in that case
4
+ if view_permission && !Role.anonymous.permissions.include?(view_permission)
5
+ Role.anonymous.filters.create(:search => 'owner.id = current_user') do |filter|
6
+ filter.filterings.build { |f| f.permission = view_permission }
7
+ end
8
+ end
@@ -21,13 +21,6 @@ module ForemanTasks
21
21
  permission :edit_foreman_tasks, {:'foreman_tasks/tasks' => [:resume, :unlock, :force_unlock, :cancel_step]}, :resource_type => ForemanTasks::Task.name
22
22
  end
23
23
 
24
- view_permission = Permission.where(:name => :view_foreman_tasks, :resource_type => ForemanTasks::Task.name).first
25
- unless Role.anonymous.permissions.include?(view_permission)
26
- Role.anonymous.filters.create(:search => 'owner.id = current_user') do |filter|
27
- filter.filterings.build { |f| f.permission = view_permission }
28
- end
29
- end
30
-
31
24
  role "Tasks Manager", [:view_foreman_tasks, :edit_foreman_tasks]
32
25
  role "Tasks Reader", [:view_foreman_tasks]
33
26
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.6.11"
2
+ VERSION = "0.6.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-28 00:00:00.000000000 Z
12
+ date: 2015-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dynflow
@@ -129,6 +129,7 @@ files:
129
129
  - bin/dynflow-executor
130
130
  - bin/foreman-tasks
131
131
  - config/routes.rb
132
+ - db/seeds.d/20-foreman_tasks_permissions.rb
132
133
  - db/migrate/20131205204140_create_foreman_tasks.rb
133
134
  - db/migrate/20140324104010_remove_foreman_tasks_progress.rb
134
135
  - db/migrate/20140813215942_add_parent_task_id.rb