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

[External File Storage Connector]Local File System Connector (OnPrem) #27907

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Rename Local File Connector components to Ext. Local File Connector a…
…nd update permissions accordingly
  • Loading branch information
IceOnly committed Jan 9, 2025
commit 7c03005052e44e94859ae72ee1743bd4aa4f74d2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

namespace System.ExternalFileStorage;

permissionsetextension 4820 "File Storage - Admin - Local File" extends "File Storage - Admin"
entitlement "Ext. Local File Connector"
{
IncludedPermissionSets = "Local File - Edit";
}
Type = Implicit;

ObjectEntitlements = "Ext. Local File - Objects";
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace System.ExternalFileStorage;

permissionset 4822 "Local File - Edit"
permissionset 4822 "Ext. Local File - Edit"
{
Assignable = false;
Access = Public;
Caption = 'Local File - Edit';

IncludedPermissionSets = "Local File - Read";
IncludedPermissionSets = "Ext. Local File - Read";

Permissions =
tabledata "Local File Account" = imd;
tabledata "Ext. Local File Account" = imd;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@

namespace System.ExternalFileStorage;

permissionset 4820 "Local File - Objects"
permissionset 4820 "Ext. Local File - Objects"
{
Assignable = false;
Access = Public;
Caption = 'Local File - Objects';

Permissions =
table "Local File Account" = X,
codeunit "Local File Connector Impl." = X,
page "Local File Account Wizard" = X,
page "Local File Account" = X;
table "Ext. Local File Account" = X,
page "Ext. Local File Account Wizard" = X,
page "Ext. Local File Account" = X;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

namespace System.ExternalFileStorage;

permissionset 4821 "Local File - Read"
permissionset 4821 "Ext. Local File - Read"
{
Assignable = false;
Access = Public;
Caption = 'Local File - Read';

IncludedPermissionSets = "Local File - Objects";
IncludedPermissionSets = "Ext. Local File - Objects";

Permissions =
tabledata "Local File Account" = r;
tabledata "Ext. Local File Account" = r;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionsetextension 4820 "File Storage - Admin - Ext. Local File" extends "File Storage - Admin"
{
IncludedPermissionSets = "Ext. Local File - Edit";
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace System.ExternalFileStorage;
/// <summary>
/// Displays an account that was registered via the File Share connector.
/// </summary>
page 4820 "Local File Account"
page 4820 "Ext. Local File Account"
{
ApplicationArea = All;
SourceTable = "Local File Account";
SourceTable = "Ext. Local File Account";
Caption = 'Local File Account';
Permissions = tabledata "Local File Account" = rimd;
Permissions = tabledata "Ext. Local File Account" = rimd;
PageType = Card;
Extensible = false;
InsertAllowed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace System.ExternalFileStorage;
/// <summary>
/// Holds the information for all file accounts that are registered via the File Share connector
/// </summary>
table 4820 "Local File Account"
table 4820 "Ext. Local File Account"
{
Access = Internal;
DataClassification = CustomerContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Using System.Environment;
/// <summary>
/// Displays an account that is being registered via the File Share connector.
/// </summary>
page 4821 "Local File Account Wizard"
page 4821 "Ext. Local File Account Wizard"
{
Caption = 'Setup Local File Account';
SourceTable = "Local File Account";
SourceTable = "Ext. Local File Account";
SourceTableTemporary = true;
Permissions = tabledata "Local File Account" = rimd;
Permissions = tabledata "Ext. Local File Account" = rimd;
PageType = NavigatePage;
Extensible = false;
Editable = true;
Expand Down Expand Up @@ -107,7 +107,7 @@ page 4821 "Local File Account Wizard"
var
LocalFileAccount: Record "File Account";
MediaResources: Record "Media Resources";
FileShareConnectorImpl: Codeunit "Local File Connector Impl.";
FileShareConnectorImpl: Codeunit "Ext. Local File Connector Impl";
IsNextEnabled: Boolean;
TopBannerVisible: Boolean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace System.ExternalFileStorage;
/// <summary>
/// Enum extension to register the File Share connector.
/// </summary>
enumextension 4820 "Local File Connector" extends "Ext. File Storage Connector"
enumextension 4820 "Ext. Local File Connector" extends "Ext. File Storage Connector"
{
/// <summary>
/// The File Share connector.
/// </summary>
value(4820; "Local File")
{
Caption = 'Local File';
Implementation = "External File Storage Connector" = "Local File Connector Impl.";
Implementation = "External File Storage Connector" = "Ext. Local File Connector Impl";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ namespace System.ExternalFileStorage;

using System.Text;
using System.Utilities;
using System.Azure.Storage;
using System.Azure.Storage.Files;
using System.IO;
using System;

codeunit 4820 "Local File Connector Impl." implements "External File Storage Connector"
codeunit 4820 "Ext. Local File Connector Impl" implements "External File Storage Connector"
{
Access = Internal;
Permissions = tabledata "Local File Account" = rimd;
Permissions = tabledata "Ext. Local File Account" = rimd;
InherentPermissions = X;
InherentEntitlements = X;

var
ConnectorDescriptionTxt: Label 'Use Local File to store and retrieve files from the server file system.';
Expand All @@ -30,7 +30,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <param name="Files">A list with all files stored in the path.</param>
procedure ListFiles(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var FileAccountContent: Record "File Account Content" temporary)
var
LocalFileAccount: Record "Local File Account";
LocalFileAccount: Record "Ext. Local File Account";
LocalFile: Record File;
begin
LocalFileAccount.Get(AccountId);
Expand Down Expand Up @@ -160,7 +160,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <param name="Files">A list with all directories stored in the path.</param>
procedure ListDirectories(AccountId: Guid; Path: Text; FilePaginationData: Codeunit "File Pagination Data"; var FileAccountContent: Record "File Account Content" temporary)
var
LocalFileAccount: Record "Local File Account";
LocalFileAccount: Record "Ext. Local File Account";
LocalFile: Record File;
begin
FilePaginationData.SetEndOfListing(true);
Expand Down Expand Up @@ -231,7 +231,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <param name="Accounts">Out parameter holding all the registered accounts for the File Share connector.</param>
procedure GetAccounts(var TempAccounts: Record "File Account" temporary)
var
Account: Record "Local File Account";
Account: Record "Ext. Local File Account";
begin
if not Account.FindSet() then
exit;
Expand All @@ -250,13 +250,13 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <param name="AccountId">The ID of the account to show.</param>
procedure ShowAccountInformation(AccountId: Guid)
var
FileShareAccountLocal: Record "Local File Account";
FileShareAccountLocal: Record "Ext. Local File Account";
begin
if not FileShareAccountLocal.Get(AccountId) then
Error(NotRegisteredAccountErr);

FileShareAccountLocal.SetRecFilter();
Page.Run(Page::"Local File Account", FileShareAccountLocal);
Page.Run(Page::"Ext. Local File Account", FileShareAccountLocal);
end;

/// <summary>
Expand All @@ -266,7 +266,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <returns>True if the registration was successful; false - otherwise.</returns>
procedure RegisterAccount(var TempAccount: Record "File Account" temporary): Boolean
var
FileShareAccountWizard: Page "Local File Account Wizard";
FileShareAccountWizard: Page "Ext. Local File Account Wizard";
begin
FileShareAccountWizard.RunModal();

Expand All @@ -280,7 +280,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
/// <returns>True if an account was deleted.</returns>
procedure DeleteAccount(AccountId: Guid): Boolean
var
FileShareAccountLocal: Record "Local File Account";
FileShareAccountLocal: Record "Ext. Local File Account";
begin
if FileShareAccountLocal.Get(AccountId) then
exit(FileShareAccountLocal.Delete());
Expand Down Expand Up @@ -310,7 +310,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
exit(Base64Convert.ToBase64(Stream));
end;

internal procedure IsAccountValid(var Account: Record "Local File Account" temporary): Boolean
internal procedure IsAccountValid(var Account: Record "Ext. Local File Account" temporary): Boolean
begin
if Account.Name = '' then
exit(false);
Expand All @@ -322,9 +322,9 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
end;

[NonDebuggable]
internal procedure CreateAccount(var AccountToCopy: Record "Local File Account"; var FileAccount: Record "File Account")
internal procedure CreateAccount(var AccountToCopy: Record "Ext. Local File Account"; var FileAccount: Record "File Account")
var
NewFileShareAccount: Record "Local File Account";
NewFileShareAccount: Record "Ext. Local File Account";
begin
NewFileShareAccount.TransferFields(AccountToCopy);
NewFileShareAccount.Id := CreateGuid();
Expand Down Expand Up @@ -359,7 +359,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con

local procedure GetLocalPath(AccountId: Guid; Path: Text) LocalPath: Text
var
LocalFileAccount: Record "Local File Account";
LocalFileAccount: Record "Ext. Local File Account";
begin
LocalFileAccount.Get(AccountId);
LocalFileAccount.TestField("Base Path");
Expand All @@ -378,7 +378,7 @@ codeunit 4820 "Local File Connector Impl." implements "External File Storage Con
exit(Path.Replace(PathSeparator(), '\'));
end;

local procedure GetParentPath(LocalFileAccount: Record "Local File Account"; Path: Text): Text
local procedure GetParentPath(LocalFileAccount: Record "Ext. Local File Account"; Path: Text): Text
var
LocalPath: Text;
begin
Expand Down
Loading