Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Jun 26, 2021
1 parent b24bae0 commit bd039ea
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 21 deletions.
38 changes: 31 additions & 7 deletions docs/commands/folder-permissions/New-TssFolderPermission.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Create a new folder permission
## SYNTAX

```
New-TssFolderPermission [-TssSession] <TssSession> -FolderId <Int32> [-GroupId <Int32>] [-UserId <Int32>]
-FolderAccessRoleName <String> -SecretAccessRoleName <String> [-WhatIf] [-Confirm] [<CommonParameters>]
New-TssFolderPermission [-TssSession] <TssSession> -FolderId <Int32[]> [-GroupId <Int32>] [-UserId <Int32>]
-FolderAccessRoleName <String> -SecretAccessRoleName <String> [-Force] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Create a new folder permission
Create a new folder permission, use -Force to break inheritance

## EXAMPLES

Expand All @@ -23,6 +24,14 @@ New-TssFolderPermission -TssSession $session -FolderId 5 -UserId 21 -FolderAcces

Creates a folder permission on Folder ID 5 for User ID 21 granting View on the Folder-level and List on the Secrets in the folder

### EXAMPLE 2
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
New-TssFolderPermission -TssSession $session -FolderId 46 -GroupId 12 -FolderAccessRoleName Owner -SecretAccessRoleName Owner -Force
```

Creates a folder permission on Folder ID 46 for Group ID 21, giving Owner for Folder and Secrets, breaking InheritPermissions if enabled

## PARAMETERS

### -TssSession
Expand All @@ -44,13 +53,13 @@ Accept wildcard characters: False
Folder ID
```yaml
Type: Int32
Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
Expand Down Expand Up @@ -86,7 +95,7 @@ Accept wildcard characters: False
```
### -FolderAccessRoleName
Folder Access Role Name
Folder Access Role Name (View, Edit, Add Secret, Owner)
```yaml
Type: String
Expand All @@ -101,7 +110,7 @@ Accept wildcard characters: False
```
### -SecretAccessRoleName
Secret Access Role Name
Secret Access Role Name (View, Edit, List, Owner, None)
```yaml
Type: String
Expand All @@ -115,6 +124,21 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Force
If provided will break inheritance on the folder and add the permission
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Expand Down
176 changes: 176 additions & 0 deletions docs/commands/folders/Add-TssFolderPermission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Add-TssFolderPermission

## SYNOPSIS
Add a User or Group permission to a Folder

## SYNTAX

### user
```
Add-TssFolderPermission [-TssSession] <TssSession> -FolderId <Int32[]> -Username <String> -FolderRole <String>
-SecretRole <String> [-Force] [<CommonParameters>]
```

### group
```
Add-TssFolderPermission [-TssSession] <TssSession> -FolderId <Int32[]> -Group <String> -FolderRole <String>
-SecretRole <String> [-Force] [<CommonParameters>]
```

## DESCRIPTION
Add a User or Group permission to a Folder.
Use -Force to break inheritance.

## EXAMPLES

### EXAMPLE 1
```
session = New-TssSession -SecretServer https://alpha -Credential $ssCred
Add-TssFolderPermission -TssSession $session -Id 65 -Type User -Name bob -FolderRole Owner -SecretRole Edit
```

Add bob to Folder 65 granting Folder role of owner and Secret role of Edit

### EXAMPLE 2
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
$folders = Search-TssFolder -TssSession $session | Where-Object -not InheritPermission
$folders | Add-TssFolderPermission -TssSession $session -Username chance.wayne -FolderRole View -SecretRole List
```

Add "chance.wayne" to all Folders that do not have Inherit Permissions enabled.
Granting Folder role of View and Secret Role of List

### EXAMPLE 3
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
$folders = Search-TssFolder -TssSession $session -SearchText 'App'
$folders | Add-TssFolderPermission -TssSession $session -Username chad -FolderRole Owner -SecretRole Owner -Force
```

Add "chad" as owner for Folder and Secret on Folders that have "App" in their name, will also break inheritance if enabled on any of the Folders

## PARAMETERS

### -TssSession
TssSession object created by New-TssSession for auth

```yaml
Type: TssSession
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -FolderId
Folder ID
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -Username
Name of user to add
```yaml
Type: String
Parameter Sets: user
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Group
Name of group to add
```yaml
Type: String
Parameter Sets: group
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -FolderRole
Folder Access Role (View, Edit, Add Secret, Owner)
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SecretRole
Secret Access Role (View, Edit, List, Owner, None)
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Force
If provided will break inheritance on the folder and add the permission
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### TssFolderPermission
## NOTES
Requires TssSession object returned by New-TssSession
## RELATED LINKS
[https://thycotic-ps.github.io/thycotic.secretserver/commands/folders/Add-TssFolderPermission](https://thycotic-ps.github.io/thycotic.secretserver/commands/folders/Add-TssFolderPermission)
[https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/folders/Add-FolderPermission.ps1](https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/folders/Add-FolderPermission.ps1)
68 changes: 54 additions & 14 deletions docs/commands/secret-permissions/New-TssSecretPermission.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,32 @@ Create a new Secret Permission
## SYNTAX

```
New-TssSecretPermission [-TssSession] <TssSession> -SecretId <String> -AccessRole <String> [-GroupId <Int32>]
[-UserId <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-TssSecretPermission [-TssSession] <TssSession> -SecretId <Int32[]> -AccessRole <String>
[-DomainName <String>] [-GroupName <String>] [-Username <String>] [-Force] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

## DESCRIPTION
Create a new Secret Permission
Create a new Secret Permission, use -Force to break inheritance

## EXAMPLES

### EXAMPLE 1
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
New-TssSecretPermission -TssSession $session -SecretId 76 -AccessRole View -UserId 98
New-TssSecretPermission -TssSession $session -SecretId 76 -AccessRole View -Username bob.martin
```

Adding permission for User ID 98 to Secret 76, granting View rights to the Secret.
Adding user "bob.martin" to Secret 76, granting View rights to the Secret.

### EXAMPLE 2
```
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred
$secrets = Search-TssSecret -TssSession $session -SearchText 'Azure'
New-TssSecretPermission -TssSession $session -SecretId $secrets.Id -AccessRole View -DomainName corp -GroupName 'IT Support' -Force
```

Adding permission to all Secrets that have "Azure" in their name to the group "corp\IT Support" with View rights, breaking inheritance if enabled.

## PARAMETERS

Expand All @@ -44,7 +54,7 @@ Accept wildcard characters: False
Secret Id
```yaml
Type: String
Type: Int32[]
Parameter Sets: (All)
Aliases:

Expand All @@ -70,36 +80,66 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -GroupId
Group ID
### -DomainName
Domain Name (the friendly name), if user or group is an Directory Service domain
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -GroupName
Group Name
```yaml
Type: Int32
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -UserId
User ID
### -Username
Username
```yaml
Type: Int32
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -Force
If provided will break inheritance on the secret and add the permission
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Expand Down
Loading

0 comments on commit bd039ea

Please sign in to comment.