Skip to content

Commit

Permalink
Adjust FolderPermissions Class - rename namespace and classes, align …
Browse files Browse the repository at this point in the history
…functions

fixes #215
  • Loading branch information
wsmelton committed Jul 27, 2021
1 parent 291317b commit 9c00b69
Show file tree
Hide file tree
Showing 23 changed files with 121 additions and 121 deletions.
40 changes: 0 additions & 40 deletions docs/about_topics/folder-permissions/General.md

This file was deleted.

58 changes: 58 additions & 0 deletions docs/about_topics/folder-permissions/Permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: "Permission"
---

# TOPIC
This help topic describes the Thycotic.PowerShell.FolderPermissions.Permission class in the Thycotic.SecretServer module

# CLASS
Thycotic.PowerShell.FolderPermissions.Permission

# INHERITANCE
None

# DESCRIPTION
The Thycotic.PowerShell.FolderPermissions.Permission class represents the FolderPermissionSummary object returned by Secret Server endpoint GET /folder-permissions

# CONSTRUCTORS
new()

# PROPERTIES
FolderAccessRoleId
Role ID granted on the folder

FolderAccessRoleName
Role name granted on the folder

FolderId
Folder ID

GroupId
Group ID having permissions on the folder

GroupName
Group name having permissions on the folder

Id
Folder permission ID

KnownAs
KnownAs

SecretAccessRoleId
Role ID granted on secrets in the folder

SecretAccessRoleName
Role name granted on secrets in the folder

UserId
User ID having permissions on the folder

UserName
User name having permissions on the folder

# METHODS

# RELATED LINKS:
Get-TssFolderPermission
New-TssFolderPermission
34 changes: 8 additions & 26 deletions docs/about_topics/folder-permissions/Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,35 @@ title: "Summary"
---

# TOPIC
This help topic describes the Thycotic.PowerShell.FolderPermission.Summary class in the Thycotic.SecretServer module
This help topic describes the Thycotic.PowerShell.FolderPermissions.Summary class in the Thycotic.SecretServer module

# CLASS
Thycotic.PowerShell.FolderPermission.Summary
Thycotic.PowerShell.FolderPermissions.Summary

# INHERITANCE
None

# DESCRIPTION
The Thycotic.PowerShell.FolderPermission.Summary class represents the FolderPermissionSummary object returned by Secret Server endpoint GET /folder-permissions
The Thycotic.PowerShell.FolderPermissions.Summary class represents the FolderPermissionModel object returned by Secret Server endpoint GET /folder-permissions/{id}

# CONSTRUCTORS
new()

# PROPERTIES
FolderAccessRoleId
Role ID granted on the folder
Folder Access Role Id

FolderAccessRoleName
Role name granted on the folder

FolderId
Folder ID
Permission on the folder

GroupId
Group ID having permissions on the folder

GroupName
Group name having permissions on the folder

Id
Folder permission ID

KnownAs
KnownAs
Group Id

SecretAccessRoleId
Role ID granted on secrets in the folder
Secret Access Role Id

SecretAccessRoleName
Role name granted on secrets in the folder

UserId
User ID having permissions on the folder

UserName
User name having permissions on the folder
Permission on the secrets in the folder

# METHODS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.FolderPermission.General
### Thycotic.PowerShell.FolderPermissions.Permission
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.FolderPermission.General
### Thycotic.PowerShell.FolderPermissions.Permission
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.FolderPermission.Summary
### Thycotic.PowerShell.FolderPermissions.Permission
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.FolderPermission.Summary
### Thycotic.PowerShell.FolderPermissions.Permission
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/folders/Add-TssFolderPermission.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.FolderPermission.General
### Thycotic.PowerShell.FolderPermissions.Permission
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
4 changes: 2 additions & 2 deletions src/Thycotic.SecretServer.Format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,9 @@

<!-- Search-TssFolderPermission -->
<View>
<Name>FolderPermissionSummary</Name>
<Name>FolderPermission</Name>
<ViewSelectedBy>
<TypeName>Thycotic.PowerShell.FolderPermission.Summary</TypeName>
<TypeName>Thycotic.PowerShell.FolderPermissions.Permission</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down
2 changes: 1 addition & 1 deletion src/Thycotic.SecretServer.Types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</Members>
</Type>
<Type>
<Name>Thycotic.PowerShell.FolerPermission.Summary</Name>
<Name>Thycotic.PowerShell.FolderPermissions.Permission</Name>
<Members>
<AliasProperty>
<Name>FolderPermissionId</Name>
Expand Down
16 changes: 0 additions & 16 deletions src/Thycotic.SecretServer/classes/folder-permissions/General.cs

This file was deleted.

22 changes: 22 additions & 0 deletions src/Thycotic.SecretServer/classes/folder-permissions/Permission.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.FolderPermissions
{
public class Permission
{
public int FolderAccessRoleId {get;set;}
public string FolderAccessRoleName {get;set;}
public int FolderId {get;set;}
public int GroupId {get;set;}
public string GroupName {get;set;}
public int Id {get;set;}
public string KnownAs {get;set;}
public int SecretAccessRoleId {get;set;}
public string SecretAccessRoleName {get;set;}
public int UserId {get;set;}
public string Username {get;set;}
}
}
18 changes: 6 additions & 12 deletions src/Thycotic.SecretServer/classes/folder-permissions/Summary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.FolderPermission
namespace Thycotic.PowerShell.FolderPermissions
{
public class Summary
{
public int FolderAccessRoleId {get;set;}
public string FolderAccessRoleName {get;set;}
public int FolderId {get;set;}
public int GroupId {get;set;}
public string GroupName {get;set;}
public int Id {get;set;}
public string KnownAs {get;set;}
public int SecretAccessRoleId {get;set;}
public string SecretAccessRoleName {get;set;}
public int UserId {get;set;}
public string Username {get;set;}
public int FolderAccessRoleId { get; set; }
public string FolderAccessRoleName { get; set; }
public int GroupId { get; set; }
public int SecretAccessRoleId { get; set; }
public string SecretAccessRoleName { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/functions/folder-permissions/Get-TssFolderPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Get-TssFolderPermission {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding()]
[OutputType('Thycotic.PowerShell.FolderPermission.General')]
[OutputType('Thycotic.PowerShell.FolderPermissions.Permission')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory,
Expand Down Expand Up @@ -65,7 +65,7 @@ function Get-TssFolderPermission {
}

if ($restResponse) {
[Thycotic.PowerShell.FolderPermission.General]$restResponse
[Thycotic.PowerShell.FolderPermissions.Permission]$restResponse
}
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/functions/folder-permissions/New-TssFolderPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function New-TssFolderPermission {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding(SupportsShouldProcess)]
[OutputType('Thycotic.PowerShell.FolderPermission.General')]
[OutputType('Thycotic.PowerShell.FolderPermissions.Permission')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory, ValueFromPipeline, Position = 0)]
Expand Down Expand Up @@ -115,7 +115,7 @@ function New-TssFolderPermission {
}

if ($restResponse) {
[Thycotic.PowerShell.FolderPermission.General]$restResponse
[Thycotic.PowerShell.FolderPermissions.Permission]$restResponse
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Search-TssFolderPermission {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding()]
[OutputType('Thycotic.PowerShell.FolderPermission.Summary')]
[OutputType('Thycotic.PowerShell.FolderPermissions.Permission')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory,
Expand Down Expand Up @@ -92,7 +92,7 @@ function Search-TssFolderPermission {
Write-Warning 'No Folder Permissions found'
}
if ($restResponse.records) {
[Thycotic.PowerShell.FolderPermission.Summary[]]$restResponse.records
[Thycotic.PowerShell.FolderPermissions.Permission[]]$restResponse.records
}
} else {
Write-Error 'Please provide one of the following parameters: -FolderId, -GroupId or -UserId'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Update-TssFolderPermission {
Requires TssSession object returned by New-TssSession
#>
[cmdletbinding(SupportsShouldProcess)]
[OutputType('Thycotic.PowerShell.FolderPermission.Summary')]
[OutputType('Thycotic.PowerShell.FolderPermissions.Permission')]
param(
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory,
Expand Down Expand Up @@ -100,7 +100,7 @@ function Update-TssFolderPermission {
}
}
if ($restResponse) {
[Thycotic.PowerShell.FolderPermission.Summary]$restResponse
[Thycotic.PowerShell.FolderPermissions.Permission]$restResponse
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/functions/folders/Add-TssFolderPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Add-TssFolderPermission {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding()]
[OutputType('Thycotic.PowerShell.FolderPermission.General')]
[OutputType('Thycotic.PowerShell.FolderPermissions.Permission')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory, ValueFromPipeline, Position = 0)]
Expand Down
4 changes: 2 additions & 2 deletions tests/folder-permissions/Get-TssFolderPermission.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Describe "$commandName verify parameters" {
}
}
Context "Command specific details" {
It "$commandName should set OutputType to Thycotic.PowerShell.FolderPermission.General" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'Thycotic.PowerShell.FolderPermission.General'
It "$commandName should set OutputType to Thycotic.PowerShell.FolderPermissions.Permission" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'Thycotic.PowerShell.FolderPermissions.Permission'
}
}
}
Loading

0 comments on commit 9c00b69

Please sign in to comment.