mdata 1.4.3 → 1.5.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 +4 -4
- data/README.markdown +1 -7
- data/VERSION +1 -0
- data/bin/mdata +88 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2c96e2f34af88520857c1428fac4b9bf96c4049
|
4
|
+
data.tar.gz: f8732d5359e0e063a29c575ff63691c9bb1b6100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30f5a97c1bb3be5d780903068f34de0c49f8150ae8e32ce217a0df228ab75c08e0501138db5b8184db697e0c3a41ee75131c063bee6e79c30a02adf149ebfe12
|
7
|
+
data.tar.gz: 77999c4a15fd17e06a63aa61b2e5b2e6af18958b372e3957402f6fdc424feaad82ef78c27a0c89dc5275f17a25eed8c0b99274058bf5503c742ce30d64606bf4
|
data/README.markdown
CHANGED
@@ -50,10 +50,4 @@ In this example, we will release version 0.0.0 of `mdata`. The version number sh
|
|
50
50
|
0. Create an entry in `CHANGELOG.markdown` for v0.0.0 and list the newly added features, fixed bugs, deprecated commands, etc.
|
51
51
|
0. Make sure any newly-created files have been added to `mdata.gemspec` (if necessary)
|
52
52
|
0. Run `rake`. **DO NOT PROCEED IF THERE ARE ERRORS/FAILURES.**
|
53
|
-
0.
|
54
|
-
0. Update the version to 0.0.0 in `mdata.gemspec`.
|
55
|
-
0. `git add bin/mdata mdata.gemspec CHANGELOG.markdown`
|
56
|
-
0. `git commit -m "Bump version to 0.0.0"`
|
57
|
-
0. `git tag -s v0.0.0 -m "Release version 0.0.0 to RubyGems"`
|
58
|
-
0. `gem build mdata.gemspec`
|
59
|
-
0. `gem push mdata-0.0.0.gem`
|
53
|
+
0. Run `./release.sh 0.0.0` to update the internal version info, push a signed release tag, and build and push the RubyGem
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.5.0
|
data/bin/mdata
CHANGED
@@ -5,7 +5,7 @@ require 'commander/import'
|
|
5
5
|
require 'mdata/metadata'
|
6
6
|
require 'terminal-table'
|
7
7
|
|
8
|
-
program :version,
|
8
|
+
program :version, File.read(File.expand_path('../../VERSION', __FILE__))
|
9
9
|
program :description, 'Your Salesforce metadata navigator and manipulator'
|
10
10
|
program :help, 'Author', 'Ben Burwell <ben.burwell@trifecta.com>'
|
11
11
|
|
@@ -44,12 +44,14 @@ command :'profile fieldPermissions:read' do |c|
|
|
44
44
|
c.syntax = 'mdata profile fieldPermission:read --profile PROFILE [options]'
|
45
45
|
c.summary = 'See what permissions a particular profile is granted'
|
46
46
|
c.option '--profile PROFILE', String, 'The profile to examine'
|
47
|
+
c.option '--object OBJECT', String, 'Optionally, the object to examine'
|
47
48
|
c.option '--field FIELD', String, 'Optionally, a specific field to look for.'
|
48
49
|
c.action do |args, opts|
|
49
50
|
begin
|
50
51
|
raise ArgumentError, 'no profile specified' if opts.profile.nil?
|
51
52
|
profile = Salesforce::Metadata::Profile.read opts.profile, opts.dir
|
52
53
|
profile.fieldPermissions.keep_if { |x| x.field == opts.field } unless opts.field.nil?
|
54
|
+
profile.fieldPermissions.keep_if { |x| x.field.split('.')[0] == opts.object } unless opts.object.nil?
|
53
55
|
profile.fieldPermissions.sort! { |a, b| a.field <=> b.field }
|
54
56
|
rows = []
|
55
57
|
profile.fieldPermissions.each do |fp|
|
@@ -399,6 +401,47 @@ command :'profile classAccess:copy' do |c|
|
|
399
401
|
end
|
400
402
|
end
|
401
403
|
|
404
|
+
command :'profile tabVisibilities:read' do |c|
|
405
|
+
c.syntax = 'mdata profile tabVisibilities:read --profile PROFILE [options]'
|
406
|
+
c.summary = 'Read tab permissions from a profile'
|
407
|
+
c.option '--profile PROFILE', String, 'The profile to examine'
|
408
|
+
c.option '--tab TAB', String, 'Optionally, an tab to look for'
|
409
|
+
c.action do |args, opts|
|
410
|
+
begin
|
411
|
+
raise ArgumentError, 'no profile specified' if opts.profile.nil?
|
412
|
+
profile = Salesforce::Metadata::Profile.read opts.profile, opts.dir
|
413
|
+
profile.tabVisibilities.keep_if { |x| x.tab == opts.tab } unless opts.tab.nil?
|
414
|
+
profile.tabVisibilities.sort! { |a, b| a.tab <=> b.tab }
|
415
|
+
rows = []
|
416
|
+
profile.tabVisibilities.each do |fp|
|
417
|
+
rows << [ fp.tab, fp.visibility ]
|
418
|
+
end
|
419
|
+
table = Terminal::Table.new :rows => rows, :headings => ['Tab', 'Visibility']
|
420
|
+
puts table
|
421
|
+
rescue ArgumentError => e
|
422
|
+
puts "Error executing command: #{e.message}"
|
423
|
+
end
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
427
|
+
command :'profile tabVisibilities:delete' do |c|
|
428
|
+
c.syntax = 'mdata profile tabVisibilities:delete --profile PROFILE --tab OBJECT'
|
429
|
+
c.summary = 'Completely removes the visibility for a particular tab. Useful if a tab is deleted.'
|
430
|
+
c.option '--profile PROFILE', String, 'The profile to configure'
|
431
|
+
c.option '--tab OBJECT', String, 'The tab to delete visibility for'
|
432
|
+
c.action do |args, opts|
|
433
|
+
begin
|
434
|
+
raise ArgumentError, 'no profile specified' if opts.profile.nil?
|
435
|
+
raise ArgumentError, 'no tab specified' if opts.tab.nil?
|
436
|
+
profile = Salesforce::Metadata::Profile.read opts.profile, opts.dir
|
437
|
+
profile.tabVisibilities.delete_if { |x| x.tab == opts.tab }
|
438
|
+
profile.save
|
439
|
+
rescue ArgumentError => e
|
440
|
+
puts "Error executing command: #{e.message}"
|
441
|
+
end
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
402
445
|
command :'profile objectPermissions:read' do |c|
|
403
446
|
c.syntax = 'mdata profile objectPermissions:read --profile PROFILE [options]'
|
404
447
|
c.summary = 'Read object permissions from a profile'
|
@@ -563,12 +606,14 @@ command :'profile objectPermissions:delete' do |c|
|
|
563
606
|
c.summary = 'Completely removes the permissions for a particular object. Useful if an object is deleted.'
|
564
607
|
c.option '--profile PROFILE', String, 'The profile to configure'
|
565
608
|
c.option '--object OBJECT', String, 'The object to delete permissions for'
|
609
|
+
c.option '--cascade', String, 'If true, will cascade deletion to fields on the object as well'
|
566
610
|
c.action do |args, opts|
|
567
611
|
begin
|
568
612
|
raise ArgumentError, 'no profile specified' if opts.profile.nil?
|
569
613
|
raise ArgumentError, 'no object specified' if opts.object.nil?
|
570
614
|
profile = Salesforce::Metadata::Profile.read opts.profile, opts.dir
|
571
615
|
profile.objectPermissions.delete_if { |x| x.object == opts.object }
|
616
|
+
profile.fieldPermissions.delete_if { |x| x.field.split('.')[0] == opts.object } unless opts.cascade.nil?
|
572
617
|
profile.save
|
573
618
|
rescue ArgumentError => e
|
574
619
|
puts "Error executing command: #{e.message}"
|
@@ -673,11 +718,13 @@ command :'permissionset fieldPermissions:read' do |c|
|
|
673
718
|
c.summary = 'See what permissions a particular permissionset is granted'
|
674
719
|
c.option '--permissionset PERMISSIONSET', String, 'The permissionset to examine'
|
675
720
|
c.option '--field FIELD', String, 'Optionally, a specific field to look for.'
|
721
|
+
c.option '--object OBJECT', String, 'Optionally, an object to look for.'
|
676
722
|
c.action do |args, opts|
|
677
723
|
begin
|
678
724
|
raise ArgumentError, 'no permissionset specified' if opts.permissionset.nil?
|
679
725
|
permissionset = Salesforce::Metadata::PermissionSet.read opts.permissionset, opts.dir
|
680
726
|
permissionset.fieldPermissions.keep_if { |x| x.field == opts.field } unless opts.field.nil?
|
727
|
+
permissionset.fieldPermissions.keep_if { |x| x.field.split('.')[0] == opts.object } unless opts.object.nil?
|
681
728
|
permissionset.fieldPermissions.sort! { |a, b| a.field <=> b.field }
|
682
729
|
rows = []
|
683
730
|
permissionset.fieldPermissions.each do |fp|
|
@@ -693,6 +740,46 @@ command :'permissionset fieldPermissions:read' do |c|
|
|
693
740
|
end
|
694
741
|
end
|
695
742
|
|
743
|
+
# Permissionsets - Object Permissions - Delete
|
744
|
+
command :'permissionset objectPermissions:delete' do |c|
|
745
|
+
c.syntax = 'mdata permissionset objectPermissions:delete --permissionset PERMISSIONSET --object OBJECT'
|
746
|
+
c.summary = 'Completely removes the permissions for a particular object. Useful if an object is deleted.'
|
747
|
+
c.option '--permissionset PERMISSIONSET', String, 'The permissionset to configure'
|
748
|
+
c.option '--object OBJECT', String, 'The object to delete permissions for'
|
749
|
+
c.option '--cascade', String, 'If true, will cascade deletion to fields on the object as well'
|
750
|
+
c.action do |args, opts|
|
751
|
+
begin
|
752
|
+
raise ArgumentError, 'no permissionset specified' if opts.permissionset.nil?
|
753
|
+
raise ArgumentError, 'no object specified' if opts.object.nil?
|
754
|
+
permissionset = Salesforce::Metadata::PermissionSet.read opts.permissionset, opts.dir
|
755
|
+
permissionset.objectPermissions.delete_if { |x| x.object == opts.object }
|
756
|
+
permissionset.fieldPermissions.delete_if { |x| x.field.split('.')[0] == opts.object } unless opts.cascade.nil?
|
757
|
+
permissionset.save
|
758
|
+
rescue ArgumentError => e
|
759
|
+
puts "Error executing command: #{e.message}"
|
760
|
+
end
|
761
|
+
end
|
762
|
+
end
|
763
|
+
|
764
|
+
# Permissionsets - Tab Settings - Delete
|
765
|
+
command :'permissionset tabSettings:delete' do |c|
|
766
|
+
c.syntax = 'mdata permissionset objectPermissions:delete --permissionset PERMISSIONSET --tab TAB'
|
767
|
+
c.summary = 'Completely removes tabSettings for a particular tab. Useful if a tab is deleted.'
|
768
|
+
c.option '--permissionset PERMISSIONSET', String, 'The permissionset to configure'
|
769
|
+
c.option '--tab TAB', String, 'The tab to delete settings for'
|
770
|
+
c.action do |args, opts|
|
771
|
+
begin
|
772
|
+
raise ArgumentError, 'no permissionset specified' if opts.permissionset.nil?
|
773
|
+
raise ArgumentError, 'no tab specified' if opts.tab.nil?
|
774
|
+
permissionset = Salesforce::Metadata::PermissionSet.read opts.permissionset, opts.dir
|
775
|
+
permissionset.tabSettings.delete_if { |x| x.tab == opts.tab }
|
776
|
+
permissionset.save
|
777
|
+
rescue ArgumentError => e
|
778
|
+
puts "Error executing command: #{e.message}"
|
779
|
+
end
|
780
|
+
end
|
781
|
+
end
|
782
|
+
|
696
783
|
# permissionset - Field Permissions - Set
|
697
784
|
command :'permissionset fieldPermissions:set' do |c|
|
698
785
|
c.syntax = 'mdata permissionset fieldPermissions:set --permissionset permissionset --field FIELD [options]'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Burwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -60,6 +60,7 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
+
- VERSION
|
63
64
|
- README.markdown
|
64
65
|
- lib/mdata.rb
|
65
66
|
- lib/mdata/metadata.rb
|