Skip to content

Commit dab0c43

Browse files
Added RequiredPermissionWarnings to GetAvailableSensitivityLabel, GetDeletedFlow, GetListItem, GetSite
1 parent 5b0c7fb commit dab0c43

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

src/Commands/Lists/GetListItem.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@
44
using System.Text;
55
using System.Xml.Linq;
66
using Microsoft.SharePoint.Client;
7-
7+
using PnP.PowerShell.Commands.Attributes;
88
using PnP.PowerShell.Commands.Base.PipeBinds;
99

1010
namespace PnP.PowerShell.Commands.Lists
1111
{
1212
[Cmdlet(VerbsCommon.Get, "PnPListItem", DefaultParameterSetName = ParameterSet_ALLITEMS)]
1313
[OutputType(typeof(ListItem))]
14+
[RequiredApiApplicationPermissions("sharepoint/Sites.Selected")]
15+
[RequiredApiApplicationPermissions("sharepoint/Sites.Read.All")]
16+
[RequiredApiApplicationPermissions("sharepoint/Sites.ReadWrite.All")]
17+
[RequiredApiApplicationPermissions("sharepoint/Sites.Manage.All")]
18+
[RequiredApiApplicationPermissions("sharepoint/Sites.FullControl.All")]
19+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Read")]
20+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Write")]
21+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Manage")]
22+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.FullControl")]
23+
1424
public class GetListItem : PnPWebRetrievalsCmdlet<ListItem>
1525
{
1626
private const string ParameterSet_BYID = "By Id";

src/Commands/PowerPlatform/PowerAutomate/GetDeletedFlow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
using System.Linq;
55
using System.Management.Automation;
66
using PnP.PowerShell.Commands.Utilities;
7+
using PnP.PowerShell.Commands.Attributes;
78

89
namespace PnP.PowerShell.Commands.PowerPlatform.PowerAutomate
910
{
1011
[Cmdlet(VerbsCommon.Get, "PnPDeletedFlow", DefaultParameterSetName = ParameterSet_ALL)]
12+
[RequiredApiDelegatedPermissions("azure/user_impersonation")]
1113
public class GetDeletedFlow : PnPAzureManagementApiCmdlet
1214
{
1315
private const string ParameterSet_ALL = "All";

src/Commands/Purview/GetAvailableSensitivityLabel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using PnP.PowerShell.Commands.Base;
1+
using PnP.PowerShell.Commands.Attributes;
2+
using PnP.PowerShell.Commands.Base;
23
using PnP.PowerShell.Commands.Base.PipeBinds;
34
using PnP.PowerShell.Commands.Utilities.REST;
45
using System;
@@ -10,6 +11,8 @@ namespace PnP.PowerShell.Commands.Purview
1011
[Cmdlet(VerbsCommon.Get, "PnPAvailableSensitivityLabel")]
1112
[OutputType(typeof(IEnumerable<Model.Graph.Purview.InformationProtectionLabel>))]
1213
[OutputType(typeof(Model.Graph.Purview.InformationProtectionLabel))]
14+
[RequiredApiApplicationPermissions("graph/InformationProtectionPolicy.ReadAll")]
15+
[RequiredApiDelegatedPermissions("graph/InformationProtectionPolicy.Read")]
1316
public class GetAvailableSensitivityLabel : PnPGraphCmdlet
1417
{
1518
[Parameter(Mandatory = false)]

src/Commands/Site/GetSite.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.SharePoint.Client;
2-
2+
using PnP.PowerShell.Commands.Attributes;
33
using System;
44
using System.Linq.Expressions;
55
using System.Management.Automation;
@@ -8,6 +8,15 @@ namespace PnP.PowerShell.Commands.Site
88
{
99
[Cmdlet(VerbsCommon.Get, "PnPSite")]
1010
[OutputType(typeof(Microsoft.SharePoint.Client.Site))]
11+
[RequiredApiApplicationPermissions("sharepoint/Sites.Selected")]
12+
[RequiredApiApplicationPermissions("sharepoint/Sites.Read.All")]
13+
[RequiredApiApplicationPermissions("sharepoint/Sites.ReadWrite.All")]
14+
[RequiredApiApplicationPermissions("sharepoint/Sites.Manage.All")]
15+
[RequiredApiApplicationPermissions("sharepoint/Sites.FullControl.All")]
16+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Read")]
17+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Write")]
18+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.Manage")]
19+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.FullControl")]
1120
public class GetSite : PnPRetrievalsCmdlet<Microsoft.SharePoint.Client.Site>
1221
{
1322
protected override void ExecuteCmdlet()

0 commit comments

Comments
 (0)