-
Notifications
You must be signed in to change notification settings - Fork 622
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
Azure Blob Storage, Azure File Share and SharePoint Online Connector Apps #23225
Open
IceOnly
wants to merge
34
commits into
microsoft:main
Choose a base branch
from
IceOnly:feature/FileAccess
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,853
−0
Open
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7584061
Initial commit
IceOnly 6ecfacc
Add File Browser
IceOnly 25bc19c
Add File System Codeunit
IceOnly 959f05e
Add documentation and small changes
IceOnly 4bb4080
Fix up action
IceOnly 4acb5f1
Remove all indataset
IceOnly 74c5ece
Store Assisted Setup Image in a locked label
IceOnly f7af2e7
Add review changes
IceOnly c4cd06b
Add pagination support
IceOnly 24725be
Rename Module
IceOnly 763a7a0
Add directory support to Storage Blob Implementation
IceOnly e67351e
Use actionref in Account Browser
IceOnly ac6c08e
Add permissions
IceOnly 4d88e2c
Add permission sets
IceOnly c5fc386
Fix application area
IceOnly 248542b
Add namespace and disclaimer to all files
IceOnly 3a5573f
Merge branch 'main' of https://github.com/microsoft/ALAppExtensions i…
IceOnly 06d382a
Fix version
IceOnly 32793d8
Remove system apps
IceOnly d256d81
Remove app.json
IceOnly 5965d1b
Update app.json
IceOnly 4bda136
Fix app.json
IceOnly 7c10d31
Update to BC24
IceOnly a02efa8
Rename app
IceOnly 1008fbd
Add file share connector
IceOnly 474d088
Add both auth types
IceOnly bfca361
Apply interface changes
IceOnly d399759
Fix auth case type
IceOnly b82e490
Fix File Exists
IceOnly 5864984
Add SharePoint Connector
IceOnly 3b82bc0
Fix sharepoint connector
IceOnly e6e5ec9
Add review suggestions
IceOnly 56d5525
Remove nondebuggable from SecretText Get And Set procedures
IceOnly 7a31007
Remove old analyse variables
IceOnly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# File SharePoint Connector | ||
This conenctor allows access to Sahre Point Files and Folder. | ||
A proper App Registration with Sites.ReadWrite.All permission is needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"id": "34bfcef7-f8ed-449f-94be-74024cadba3b", | ||
"name": "File - SharePoint Connector", | ||
"publisher": "Microsoft", | ||
"brief": "Enable all users to use SharePoint Folders to save files from Business Central.", | ||
"description": "This app enables all users to store files in SharePoint Folders with Business Central.", | ||
"version": "25.0.0.0", | ||
"privacyStatement": "https://go.microsoft.com/fwlink/?linkid=724009", | ||
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120", | ||
"help": "https://go.microsoft.com/fwlink/?linkid=2134520", | ||
"url": "https://go.microsoft.com/fwlink/?linkid=724011", | ||
"logo": "ExtensionLogo.png", | ||
"application": "24.0.0.0", | ||
"internalsVisibleTo": [], | ||
"dependencies": [], | ||
"screenshots": [], | ||
"platform": "24.0.0.0", | ||
"idRanges": [ | ||
{ | ||
"from": 80300, | ||
"to": 80399 | ||
} | ||
], | ||
"target": "OnPrem", | ||
"resourceExposurePolicy": { | ||
"allowDebugging": false, | ||
"allowDownloadingSource": true, | ||
"includeSourceInSymbolFile": true | ||
}, | ||
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2134520" | ||
} |
11 changes: 11 additions & 0 deletions
11
Apps/W1/File - SharePoint Connector/app/permissions/SharePointAdmin.PermissionSetExt.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.FileSystem; | ||
|
||
permissionsetextension 80300 "SharePoint - Admin" extends "File System - Admin" | ||
{ | ||
IncludedPermissionSets = "SharePoint - Edit"; | ||
} |
18 changes: 18 additions & 0 deletions
18
Apps/W1/File - SharePoint Connector/app/permissions/SharePointEdit.PermissionSet.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace System.FileSystem; | ||
|
||
permissionset 80302 "SharePoint - Edit" | ||
{ | ||
Assignable = false; | ||
Access = Public; | ||
Caption = 'SharePoint - Edit'; | ||
|
||
IncludedPermissionSets = "SharePoint - Read"; | ||
|
||
Permissions = | ||
tabledata "SharePoint Account" = imd; | ||
} |
19 changes: 19 additions & 0 deletions
19
Apps/W1/File - SharePoint Connector/app/permissions/SharePointObjects.PermissionSet.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace System.FileSystem; | ||
|
||
permissionset 80300 "SharePoint - Objects" | ||
{ | ||
Assignable = false; | ||
Access = Public; | ||
Caption = 'SharePoint - Objects'; | ||
|
||
Permissions = | ||
table "SharePoint Account" = X, | ||
codeunit "SharePoint Connector Impl." = X, | ||
page "SharePoint Account Wizard" = X, | ||
page "SharePoint Account" = X; | ||
} |
18 changes: 18 additions & 0 deletions
18
Apps/W1/File - SharePoint Connector/app/permissions/SharePointRead.PermissionSet.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace System.FileSystem; | ||
|
||
permissionset 80301 "SharePoint - Read" | ||
{ | ||
Assignable = false; | ||
Access = Public; | ||
Caption = 'SharePoint - Read'; | ||
|
||
IncludedPermissionSets = "SharePoint - Objects"; | ||
|
||
Permissions = | ||
tabledata "SharePoint Account" = r; | ||
} |
92 changes: 92 additions & 0 deletions
92
Apps/W1/File - SharePoint Connector/app/src/SharePointAccount.Page.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace System.FileSystem; | ||
|
||
/// <summary> | ||
/// Displays an account that was registered via the SharePoint connector. | ||
/// </summary> | ||
page 80300 "SharePoint Account" | ||
{ | ||
SourceTable = "SharePoint Account"; | ||
Caption = 'SharePoint Account'; | ||
Permissions = tabledata "SharePoint Account" = rimd; | ||
PageType = Card; | ||
Extensible = false; | ||
InsertAllowed = false; | ||
DataCaptionExpression = Rec.Name; | ||
|
||
layout | ||
{ | ||
area(Content) | ||
{ | ||
field(NameField; Rec.Name) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Account Name'; | ||
ToolTip = 'Specifies the name of the storage account connection.'; | ||
ShowMandatory = true; | ||
NotBlank = true; | ||
} | ||
|
||
field("Tenant Id"; Rec."Tenant Id") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the Tenant Id of the App Registration.'; | ||
} | ||
|
||
field("Client Id"; Rec."Client Id") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the the Client Id of the App Registration.'; | ||
} | ||
|
||
field(SecretField; ClientSecret) | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'Password'; | ||
Editable = ClientSecretEditable; | ||
ExtendedDatatype = Masked; | ||
ToolTip = 'Specifies the the Client Secret of the App Registration.'; | ||
|
||
trigger OnValidate() | ||
begin | ||
Rec.SetClientSecret(ClientSecret); | ||
end; | ||
} | ||
|
||
field("SharePoint Url"; Rec."SharePoint Url") | ||
{ | ||
ApplicationArea = All; | ||
Caption = 'SharePoint Url'; | ||
ToolTip = 'Specifies the the url to your SharePoint site.'; | ||
} | ||
|
||
field("Base Relative Folder Path"; Rec."Base Relative Folder Path") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the Base Relative Folder Path to use for this account.'; | ||
} | ||
} | ||
} | ||
|
||
var | ||
ClientSecretEditable: Boolean; | ||
[NonDebuggable] | ||
ClientSecret: Text; | ||
|
||
trigger OnOpenPage() | ||
begin | ||
Rec.SetCurrentKey(Name); | ||
|
||
if not IsNullGuid(Rec."Client Secret Key") then | ||
ClientSecret := '***'; | ||
end; | ||
|
||
trigger OnAfterGetCurrRecord() | ||
begin | ||
ClientSecretEditable := CurrPage.Editable(); | ||
end; | ||
} |
86 changes: 86 additions & 0 deletions
86
Apps/W1/File - SharePoint Connector/app/src/SharePointAccount.Table.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
namespace System.FileSystem; | ||
|
||
/// <summary> | ||
/// Holds the information for all file accounts that are registered via the SharePoint connector | ||
/// </summary> | ||
table 80300 "SharePoint Account" | ||
{ | ||
Access = Internal; | ||
|
||
Caption = 'SharePoint Account'; | ||
|
||
fields | ||
{ | ||
field(1; "Id"; Guid) | ||
{ | ||
DataClassification = SystemMetadata; | ||
Caption = 'Primary Key'; | ||
} | ||
|
||
field(2; Name; Text[250]) | ||
{ | ||
DataClassification = CustomerContent; | ||
Caption = 'Name of account'; | ||
} | ||
field(4; "SharePoint Url"; Text[2048]) | ||
{ | ||
Caption = 'SharePoint Url'; | ||
} | ||
field(5; "Base Relative Folder Path"; Text[2048]) | ||
{ | ||
Caption = 'Base Relative Folder Path'; | ||
} | ||
field(6; "Tenant Id"; Text[36]) | ||
IceOnly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
Caption = 'Tenant Id'; | ||
} | ||
field(7; "Client Id"; Text[36]) | ||
{ | ||
Caption = 'Client Id'; | ||
} | ||
field(8; "Client Secret Key"; Guid) | ||
{ | ||
DataClassification = SystemMetadata; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(PK; Id) | ||
{ | ||
Clustered = true; | ||
} | ||
} | ||
|
||
var | ||
UnableToGetClientMsg: Label 'Unable to get SharePoint Account Client Secret.'; | ||
UnableToSetClientSecretMsg: Label 'Unable to set SharePoint Client Secret.'; | ||
|
||
trigger OnDelete() | ||
begin | ||
if not IsNullGuid(Rec."Client Secret Key") then | ||
if IsolatedStorage.Delete(Rec."Client Secret Key") then; | ||
end; | ||
|
||
[NonDebuggable] | ||
procedure SetClientSecret(ClientSecret: SecretText) | ||
begin | ||
if IsNullGuid(Rec."Client Secret Key") then | ||
Rec."Client Secret Key" := CreateGuid(); | ||
|
||
if not IsolatedStorage.Set(Format(Rec."Client Secret Key"), ClientSecret, DataScope::Company) then | ||
Error(UnableToSetClientSecretMsg); | ||
end; | ||
|
||
[NonDebuggable] | ||
procedure GetClientSecret(ClientSecretKey: Guid) ClientSecret: SecretText | ||
begin | ||
if not IsolatedStorage.Get(Format(ClientSecretKey), DataScope::Company, ClientSecret) then | ||
Error(UnableToGetClientMsg); | ||
end; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IceOnly could you maybe add the 2nd Authentication Type for SharePoint that was added recently .
This would require a few new Fields: Enum SharePointAuthType , a "Certificate Password Key" and a Certificate Password (Blob)
See: microsoft/BCApps#705