sharingrules

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CriteriaCmd = &cobra.Command{
	Use:   "criteria",
	Short: "Manage criteria-based sharing rules",
}
View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete -r RuleName [flags] [filename]...",
	Short: "Delete both criteria-based and owner-based sharing rules",
	Long:  "Delete both criteria-based and owner-based sharing rules. Use --type to specify the rule type, or omit to try deleting from both types.",
	Args:  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			deleteRule(file, deleteRuleName, ruleType)
		}
	},
}
View Source
var ListCmd = &cobra.Command{
	Use:   "list [flags] [filename]...",
	Short: "List both criteria-based and owner-based sharing rules",
	Long:  "List both criteria-based and owner-based sharing rules. Use --criteria-field to filter by rules that use a specific field.",
	Args:  cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			listAllRules(file, criteriaField)
		}
	},
}
View Source
var OwnerCmd = &cobra.Command{
	Use:   "owner",
	Short: "Manage owner-based sharing rules",
}
View Source
var TidyCmd = &cobra.Command{
	Use:   "tidy [flags] [filename]...",
	Short: "Tidy sharing rules",
	Long: `
Tidy sharing rules metadata.

	The --wide and --ignore-errors flags can be used to help manage
	Sharing Rule metadata stored in a git repository.

	Configure clean and smudge git filters to use force-md:
	$ git config --local filter.salesforce-sharingrules.clean 'force-md sharingrules tidy --wide --ignore-errors -'
	$ git config --local filter.salesforce-sharingrules.smudge 'force-md sharingrules tidy --ignore-errors -'

	Update .gitattributes to use the salesforce-sharingrules filter:
	*.sharingRules-meta.xml filter=salesforce-sharingrules

	The --wide flag will cause the Sharing Rule metadata to be stored in a
	flattened format that makes it easier to resolve merge conflicts.  If a child
	of a fieldPermissions element changes, for example, the entire
	fieldPermissions element will show up as changed because it's stored on a single line.

	The smudge filter will cause the metadata to be unflattened so it's available
	in the normal "long" format in the working copy.

`,
	Args: cobra.MinimumNArgs(1),
	Run: func(cmd *cobra.Command, args []string) {
		for _, file := range args {
			tidy(file)
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL