Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FolderPermissions class - reallignment on endpoint output #216

Merged
merged 3 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] -- 2021-xx-xx

### Breaking Changes

* None

### Bug Fixes

* Adjust FolderPermissions Class - rename namespace and classes, align functions fixes [#215](https://github.com/thycotic-ps/thycotic.secretserver/issues/215) [9c00b69](https://github.com/thycotic-ps/thycotic.secretserver/commit/9c00b69fd727e38a8848f1b2e45568d55694d306)

### New Stuff

* None

### General Updates

* None

### Tests

* None

## [0.49.0] -- 2021-07-26

### Breaking Changes
Expand Down
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
2 changes: 1 addition & 1 deletion src/Thycotic.SecretServer.psd1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ModuleVersion = '0.49.0'
ModuleVersion = '0.49.1'
CompatiblePSEditions = 'Desktop', 'Core'
FormatsToProcess = 'Thycotic.SecretServer.Format.ps1xml'
TypesToProcess = 'Thycotic.SecretServer.Types.ps1xml'
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
Loading