dradis-plugins 3.17.0 → 3.18.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd3c416bb51bcacabac80210bf4e03544aca51ad0705e9280e6e866f9b6998f
|
4
|
+
data.tar.gz: c1f0b3a39453af29e14b2cd15799f8a146270f06a53f19020b1de3ae5323c2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b6ea9b445c8a7e8df92a19eb9f043c981736ae3235ebfd90b941af3280ef104ed1dbda787d259daa5dc1c6259c5e8175e478e9f397d7265c5bc38767a59b747
|
7
|
+
data.tar.gz: 864ec192114ff23648e2872c583ba13d40520c807e78032731082bcb036f38240c10ed1ccec6624cace77e9131f1365ffd5fab312fabfbb858ef5ca79a29779d
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.
|
4
|
+
version: 3.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-22 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
|
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
126
|
- !ruby/object:Gem::Version
|
126
127
|
version: '0'
|
127
128
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.1.2
|
129
130
|
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
summary: Plugin manager for the Dradis Framework project.
|