Skip to content

Commit 0746bcd

Browse files
committed
Get-RsCatalogItemRole: fix bug that would always return false on inherited security
1 parent ea09b98 commit 0746bcd

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

ReportingServicesTools/Functions/Security/Get-RsCatalogItemRole.ps1

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ function Get-RsCatalogItemRole
66
<#
77
.SYNOPSIS
88
This script retrieves access to SQL Server Reporting Services Instance from users/groups.
9-
9+
1010
.DESCRIPTION
1111
This script retrieves all access on the SQL Server Reporting Services Instance located at the specified Report Server URI from the specified user/group.
12-
12+
1313
.PARAMETER Identity
1414
Specify the user or group name to retrieve access for.
1515
@@ -18,26 +18,26 @@ function Get-RsCatalogItemRole
1818
1919
.PARAMETER Recurse
2020
Recursively list subfolders with content.
21-
21+
2222
.PARAMETER ReportServerUri
2323
Specify the Report Server URL to your SQL Server Reporting Services Instance.
2424
Use the "Connect-RsReportServer" function to set/update a default value.
25-
25+
2626
.PARAMETER Credential
2727
Specify the credentials to use when connecting to the Report Server.
2828
Use the "Connect-RsReportServer" function to set/update a default value.
29-
29+
3030
.PARAMETER Proxy
3131
Report server proxy to use.
3232
Use "New-RsWebServiceProxy" to generate a proxy object for reuse.
3333
Useful when repeatedly having to connect to multiple different Report Server.
34-
34+
3535
.EXAMPLE
3636
Get-RsCatalogItemRole -Identity 'jmcgee'
3737
Description
3838
-----------
3939
This command will establish a connection to the Report Server located at http://localhost/reportserver using current user's credentials and then retrieves all access for user 'jmcgee'.
40-
40+
4141
.EXAMPLE
4242
Get-RsCatalogItemRole -ReportServerUri 'http://localhost/reportserver_sql2012' -Identity 'jeremymcgee'
4343
Description
@@ -49,7 +49,7 @@ function Get-RsCatalogItemRole
4949
Description
5050
-----------
5151
This command will establish a connection to the Report Server located at http://localhost/reportserver_2012 using current user's credentials and then retrieves all access on catalog items found at '/Path/Human Resources/'.
52-
52+
5353
.EXAMPLE
5454
Get-RsCatalogItemRole -Credential 'CaptainAwesome' -Identity 'jmcgee' -Recurse
5555
Description
@@ -62,29 +62,29 @@ function Get-RsCatalogItemRole
6262
(
6363
[string]
6464
$Identity,
65-
65+
6666
[string]
6767
$Path = "/",
6868

6969
[switch]
7070
$Recurse,
71-
71+
7272
[string]
7373
$ReportServerUri,
74-
74+
7575
[System.Management.Automation.PSCredential]
7676
$Credential,
77-
77+
7878
$Proxy
7979
)
80-
80+
8181
Begin
8282
{
8383

8484
$Proxy = New-RsWebServiceProxyHelper -BoundParameters $PSBoundParameters
8585

8686
}
87-
87+
8888
Process
8989
{
9090

@@ -101,7 +101,7 @@ function Get-RsCatalogItemRole
101101

102102
$parentType = $Proxy.GetItemType($Path)
103103

104-
$catalogItemRoles += New-RsCatalogItemRoleObject -Policy $parentPolicy -Path $Path -TypeName $parentType -ParentSecurity $false
104+
$catalogItemRoles += New-RsCatalogItemRoleObject -Policy $parentPolicy -Path $Path -TypeName $parentType -ParentSecurity $inheritParent
105105

106106

107107
if($Recurse -and $parentType -eq "Folder") {
@@ -136,10 +136,10 @@ function Get-RsCatalogItemRole
136136
$catalogItemRoles += New-RsCatalogItemRoleObject -Policy $childPolicy -Path $item.Path -TypeName $item.TypeName -ParentSecurity $inheritParent
137137
}
138138

139-
139+
140140
}
141141
}
142142

143143
return $catalogItemRoles
144144
}
145-
}
145+
}

0 commit comments

Comments
 (0)