Ejemplo n.º 1
0
 public override void ExecuteCmdlet()
 {
     ConfirmAction(
         string.Format(Resources.SetDataLakeStoreItemAcl, Path.OriginalPath),
         Path.OriginalPath,
         () =>
         DataLakeStoreFileSystemClient.SetAcl(Path.TransformedPath, Account,
                                              Acl.GetAclSpec()));
 }
 protected override void ProcessRecord()
 {
     ConfirmAction(
         Force.IsPresent,
         string.Format(Resources.SettingDataLakeStoreItemAcl, Path.FullyQualifiedPath),
         string.Format(Resources.SetDataLakeStoreItemAcl, Path.FullyQualifiedPath),
         Path.FullyQualifiedPath,
         () =>
         DataLakeStoreFileSystemClient.SetAcl(Path.Path, Account,
                                              Acl.GetAclSpec()));
 }
        public override void ExecuteCmdlet()
        {
            var aclSpec = ParameterSetName.Equals(BaseParameterSetName)
                ? Acl.GetAclSpec(false)
                : string.Format("{0}{1}:{2}", Default ? "default:" : string.Empty, AceType, Id).ToLowerInvariant();

            ConfirmAction(
                string.Format(Resources.RemoveDataLakeStoreItemAcl, string.Empty, Path.OriginalPath),
                Path.OriginalPath,
                () => { DataLakeStoreFileSystemClient.RemoveAclEntries(Path.TransformedPath, Account, aclSpec); });
        }
        public override void ExecuteCmdlet()
        {
            var aclSpec = ParameterSetName.Equals(BaseParameterSetName)
                ? Acl.GetAclSpec()
                : string.Format("{0}{1}:{2}:{3}", Default ? "default:" : string.Empty, AceType, Id,
                                DataLakeStoreItemPermissionInstance.GetPermissionString(Permissions)).ToLowerInvariant();

            ConfirmAction(
                string.Format(Resources.SetDataLakeStoreItemAcl, Path.OriginalPath),
                Path.OriginalPath,
                () =>
                DataLakeStoreFileSystemClient.ModifyAcl(Path.TransformedPath, Account,
                                                        aclSpec));
        }
        protected override void ProcessRecord()
        {
            var aclSpec = ParameterSetName.Equals(BaseParameterSetName)
                ? Acl.GetAclSpec(false)
                : string.Format("{0}{1}:{2}", Default ? "default:" : string.Empty, AceType, Id).ToLowerInvariant();

            if (!Force.IsPresent)
            {
                ConfirmAction(
                    Force.IsPresent,
                    string.Format(Resources.RemovingDataLakeStoreItemAcl, string.Empty, Path.FullyQualifiedPath),
                    string.Format(Resources.RemoveDataLakeStoreItemAcl, string.Empty, Path.FullyQualifiedPath),
                    Path.FullyQualifiedPath,
                    () => { DataLakeStoreFileSystemClient.RemoveAclEntries(Path.Path, Account, aclSpec); });
            }
            else
            {
                DataLakeStoreFileSystemClient.RemoveAclEntries(Path.Path, Account, aclSpec);
            }
        }
        protected override void ProcessRecord()
        {
            var aclSpec = ParameterSetName.Equals(BaseParameterSetName)
                ? Acl.GetAclSpec()
                : string.Format("{0}{1}:{2}:{3}", Default ? "default:" : string.Empty, AceType, Id,
                                DataLakeStoreItemPermissionInstance.GetPermissionString(Permissions)).ToLowerInvariant();

            if (!Force.IsPresent)
            {
                ConfirmAction(
                    Force.IsPresent,
                    string.Format(Resources.SettingDataLakeStoreItemAcl, Path.FullyQualifiedPath),
                    string.Format(Resources.SetDataLakeStoreItemAcl, Path.FullyQualifiedPath),
                    Path.FullyQualifiedPath,
                    () =>
                    DataLakeStoreFileSystemClient.ModifyAcl(Path.Path, Account,
                                                            aclSpec));
            }
            else
            {
                DataLakeStoreFileSystemClient.ModifyAcl(Path.Path, Account,
                                                        aclSpec);
            }
        }