dradis-plugins 3.16.0 → 3.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c4f0ca90774e75d55125b04e5574bf611c8579e67ade2769d3d199e4921f96a
4
- data.tar.gz: d9ed627116f6d865161c8c92e9dff714ebb544fc21e1374beb795ac561ef2fe6
3
+ metadata.gz: effda0b5e549316b2970ee0971d4635e1bec62747fbd5496284488aa0ef44c64
4
+ data.tar.gz: b53a7c3c71dab6fc669800b010c300198782cd5bd3f481b7ba8c6b0887e4f7e0
5
5
  SHA512:
6
- metadata.gz: 190709c04fd0bf7a5cf1c909449231acaee2f04e00b513b07f135b37689297e5db51fa94ad6e6b06b1e6eda13dc8dda168162712702c5f4c4108c3f4c6c71c7e
7
- data.tar.gz: be0b75c983d5e5f8d7d7ea04f872cc59399a973688797afafd4199f101c20e77b26c2fee914a55ec122bc060d700233e170f4abd317d7054a7a7a0b3ab349d67
6
+ metadata.gz: e101f0195effda68b32c0388e125087f4839bf8e3925fe50ddbd8825e4cdab0f670b9d21d4c3dadfea3723c33af281de98a3c38d5dd5cbbba8ce9fabf9ccf001
7
+ data.tar.gz: 58ebfdaf92b640cf873e28e942930a1d5bddd4bf17a37a2e98b3224be563ae6e460c635f0066e05981f6626f565d41bdfe511f6bc37aab37e2a2e2e66d52c145
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## Dradis Framework 3.21 (February, 2021) ##
2
+
3
+ * Rename `parent` methods to `module_parent` as `Module#parent` is deprecated.
4
+
5
+ ## Dradis Framework 3.20 (January, 2021) ##
6
+
7
+ * No changes.
8
+
9
+ ## Dradis Framework 3.19 (September, 2020) ##
10
+
11
+ * No changes.
12
+
13
+ ## Dradis Framework 3.18 (July, 2020) ##
14
+
15
+ * Added PersistentPermissions module to dry up permissions endpoints.
16
+
17
+ ## Dradis Framework 3.17 (May, 2020) ##
18
+
19
+ * No changes.
20
+
1
21
  ## Dradis Framework 3.16 (February, 2020) ##
2
22
 
3
23
  * No changes.
data/Gemfile CHANGED
@@ -1,10 +1,6 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
- #gem 'dradis_core', path: '/Users/etd/dradis/git/dradis/core'
4
- #gem 'dradis', :github => 'dradis/dradisframework' # temporarily here until 3.0.0.beta is released
5
- # git "https://github.com/dradis/dradisframework.git", :branch => 'dradis3.x' do
6
- # gem 'dradis_core'
7
- # end
3
+ source 'https://rubygems.org'
8
4
 
9
5
  # Specify your gem's dependencies in dradis-html_export.gemspec
10
6
  gemspec
@@ -0,0 +1,43 @@
1
+ module Dradis
2
+ module Plugins
3
+ module PersistentPermissions
4
+ extend ActiveSupport::Concern
5
+
6
+ def update
7
+ @user = User.authors.find(params[:id])
8
+
9
+ Permission.transaction do
10
+ Permission.where(component: self.class.component_name, user_id: params[:id]).destroy_all
11
+
12
+ permissions_params[:permissions]&.each do |permission|
13
+ # Validate the permission being created is a valid value
14
+ next unless self.class.permissions_validation.call(permission) if self.class.permissions_validation
15
+
16
+ Permission.create!(
17
+ component: self.class.component_name,
18
+ name: permission,
19
+ user_id: params[:id]
20
+ )
21
+ end
22
+ end
23
+
24
+ redirect_to main_app.edit_admin_user_permissions_path(params[:id]), notice: "#{@user.name}'s permissions have been updated."
25
+ end
26
+
27
+ private
28
+
29
+ def permissions_params
30
+ params.require(self.class.component_name).permit(permissions: [])
31
+ end
32
+
33
+ class_methods do
34
+ attr_accessor :component_name, :permissions_validation
35
+
36
+ def permissible_tool(component_name, opts = {})
37
+ self.component_name = component_name
38
+ self.permissions_validation = opts[:validation]
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -7,7 +7,7 @@ module Dradis
7
7
 
8
8
  module VERSION
9
9
  MAJOR = 3
10
- MINOR = 16
10
+ MINOR = 21
11
11
  TINY = 0
12
12
  PRE = nil
13
13
 
@@ -22,7 +22,7 @@ module Dradis::Plugins::Upload::Base
22
22
  extend ActiveSupport::Concern
23
23
 
24
24
  included do
25
- parent.extend NamespaceClassMethods
25
+ module_parent.extend NamespaceClassMethods
26
26
  end
27
27
 
28
28
  module ClassMethods
@@ -41,7 +41,7 @@ module Dradis::Plugins::Upload::Base
41
41
  # ]
42
42
  # end
43
43
  def uploaders()
44
- [parent]
44
+ [module_parent]
45
45
  end
46
46
  end
47
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.16.0
4
+ version: 3.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,6 +67,7 @@ files:
67
67
  - LICENSE
68
68
  - README.md
69
69
  - Rakefile
70
+ - app/controllers/concerns/dradis/plugins/persistent_permissions.rb
70
71
  - app/controllers/dradis/plugins/export/base_controller.rb
71
72
  - dradis-plugins.gemspec
72
73
  - lib/dradis-plugins.rb
@@ -110,7 +111,7 @@ homepage: http://dradisframework.org
110
111
  licenses:
111
112
  - GPL-2
112
113
  metadata: {}
113
- post_install_message:
114
+ post_install_message:
114
115
  rdoc_options: []
115
116
  require_paths:
116
117
  - lib
@@ -125,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  - !ruby/object:Gem::Version
126
127
  version: '0'
127
128
  requirements: []
128
- rubygems_version: 3.0.1
129
- signing_key:
129
+ rubygems_version: 3.2.4
130
+ signing_key:
130
131
  specification_version: 4
131
132
  summary: Plugin manager for the Dradis Framework project.
132
133
  test_files: