Skip to content

Commit 90ab5b8

Browse files
committed
Fixes as per review comments
1 parent 4d42f22 commit 90ab5b8

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneCommands/RemoveAzureRmDataLakeStoreItemAclEntry.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ public class RemoveAzureDataLakeStoreItemAclEntry : DataLakeStoreFileSystemCmdle
9494
)]
9595
public int Concurrency { get; set; } = -1;
9696

97-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false,
98-
HelpMessage =
97+
[Parameter(Mandatory = false, HelpMessage =
9998
"If passed then progress status is showed. Only applicable when recursive Acl remove is done."
10099
)]
101100
public SwitchParameter ShowProgress { get; set; }

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneCommands/SetAzureRmDataLakeStoreItemAcl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class SetAzureDataLakeStoreItemAcl : DataLakeStoreFileSystemCmdletBase
6565
)]
6666
public int Concurrency { get; set; } = -1;
6767

68-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false,
68+
[Parameter(Mandatory = false,
6969
HelpMessage =
7070
"If passed then progress status is showed. Only applicable when recursive Acl Set is done."
7171
)]

src/ResourceManager/DataLakeStore/Commands.DataLakeStore/DataPlaneCommands/SetAzureRmDataLakeStoreItemAclEntry.cs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class SetAzureDataLakeStoreItemAclEntry : DataLakeStoreFileSystemCmdletBa
9595
)]
9696
public int Concurrency { get; set; } = -1;
9797

98-
[Parameter(ValueFromPipelineByPropertyName = true, Mandatory = false,
98+
[Parameter(Mandatory = false,
9999
HelpMessage =
100100
"If passed then progress status is showed. Only applicable when recursive Acl modify is done."
101101
)]
@@ -106,29 +106,18 @@ public override void ExecuteCmdlet()
106106
WriteWarning(Resources.IncorrectOutputTypeWarning);
107107
var aclSpec = ParameterSetName.Equals(BaseParameterSetName)
108108
? Acl.Select(entry => entry.ParseDataLakeStoreItemAce()).ToList()
109-
: new List<AclEntry>() { new AclEntry((AclType)AceType, Id.ToString(), Default ? AclScope.Default : AclScope.Access, (AclAction)Permissions) };
110-
111-
int numNonDefaultAcls = 0;
112-
113-
if (Recurse)
114-
{
115-
foreach (var aclEntry in aclSpec)
116-
{
117-
if (aclEntry.Scope == AclScope.Access)
118-
{
119-
numNonDefaultAcls++;
120-
}
121-
}
122-
}
109+
: new List<AclEntry> { new AclEntry((AclType)AceType, Id.ToString(), Default ? AclScope.Default : AclScope.Access, (AclAction)Permissions) };
123110

111+
bool recurseAndDefaultAcls = Recurse && !aclSpec.Any(aclEntry => aclEntry.Scope == AclScope.Access);
112+
124113
// For recurse and all acls are default, give a warning message
125-
if (Recurse && numNonDefaultAcls == 0)
114+
if (recurseAndDefaultAcls)
126115
{
127116
WriteWarning(Resources.SetOnlyDefaultAclRecursively);
128117
}
129118

130119
ConfirmAction(
131-
string.Format(Resources.SetDataLakeStoreItemAcl, Path.OriginalPath) + (Recurse && numNonDefaultAcls == 0? "\n" + Resources.SetOnlyDefaultAclRecursively : ""),
120+
string.Format(Resources.SetDataLakeStoreItemAcl, Path.OriginalPath) + (recurseAndDefaultAcls ? "\n" + Resources.SetOnlyDefaultAclRecursively : ""),
132121
Path.OriginalPath,
133122
() =>
134123
{

0 commit comments

Comments
 (0)