-
Notifications
You must be signed in to change notification settings - Fork 169
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
New System App Module for easy file systems access #663
Open
IceOnly
wants to merge
59
commits into
microsoft:main
Choose a base branch
from
IceOnly:module/filesystem
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.
Open
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
3d52a6a
Move to BCApps
IceOnly 62b73a7
Upgrade to BC24
IceOnly c0276ff
Add Interface changes
IceOnly 7945909
Fix Account Browser
IceOnly 692b8b7
Change application are to new logic
IceOnly 1277528
Fix first batch of code review suggestions
IceOnly ca7455a
Add File Pagination Facade
IceOnly ae719dd
Reduce code in file browser page
IceOnly 8d8eee9
Use only test lib for internal access
IceOnly 4258a0b
Fix variable names
IceOnly 30a0622
Add review suggestions
IceOnly 5b3228a
Solve name and id conflicts
IceOnly 0cfd765
Fix test
IceOnly 0327220
Fix application areas
IceOnly 0ec94d8
Remove unused label
IceOnly 6f742e4
Simplify integer incrementation
IceOnly 33afd83
Sort variables
IceOnly f701d9f
Add Init to AddEntry
IceOnly c3cd8b5
Change tooltip to code review suggestion
IceOnly a53d936
Solve code review comments
IceOnly e6bf344
Solve code review suggestions 2
IceOnly e077767
Use labels for telemetry
IceOnly f1c251a
Fix code review suggestions
IceOnly 73ed292
Remove useless internal attributes
IceOnly 017b7d0
Refactored to media only
IceOnly 4e5968e
Fix tooltips
IceOnly 5fd8fc8
Revert GetIsLegacyActionBarEnabled change
IceOnly ecf81b5
Renumber Test Lib
IceOnly 0746146
Bump version and platform to 26.0.0.0 in app.json files
IceOnly ca63fcf
Bump version and platform to 26.0.0.0 in app.json
IceOnly 997988d
Merge branch 'main' of https://github.com/IceOnly/BCApps into module/…
IceOnly c3f3b99
Bump version and platform to 26.0.0.0 in app.json for File System module
IceOnly 63452f1
Small Fixes
StefanSosic 93edfcf
Usings sort
StefanSosic 33b84fb
Brief in app.json
StefanSosic 49c0b7b
README
StefanSosic 63e15eb
Description
StefanSosic 7977397
Fixing english
StefanSosic d368497
Fix tests
StefanSosic 55265be
Fix
StefanSosic ed3b042
Fix
StefanSosic 252a4b5
Improvements
StefanSosic 12de1df
Merge pull request #1 from StefanSosic/dev/sso/moduleFileSytem
IceOnly b3bb20d
Revert renaming of codeunit "File Scenario"
IceOnly ba7e6e8
Add review suggestions from StefanSosic
IceOnly f71d12f
Fix execution permission
IceOnly b507a1e
Fix namespace
IceOnly 60a7043
Fix id range
IceOnly 7685987
Add AddNewAccountTest, media fields seems to make trouble
IceOnly 83ec1ff
Fix codereview suggestions from StefanMaron
IceOnly 3f59121
Fix spelling errors in group names and enum references across multipl…
IceOnly eb1c518
Update src/System Application/App/File System/src/Account/FileAccount…
IceOnly d81716b
Update src/System Application/App/File System/src/Account/FileAccount…
IceOnly 8f5fc54
Rename FileAccountBrowser to StorageBrowser and update related refere…
IceOnly 3f8fff0
Update src/System Application/App/File System/src/Account/FileAccount…
IceOnly 82fe7b9
Refactor permission set and update label names for clarity; streamlin…
IceOnly b7f7503
Rename File System to External File Storage and update related descri…
IceOnly 449f813
Rename File System to External File Storage and update related namesp…
IceOnly 93808f8
Tweak readme a little.
JesperSchulz 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
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,7 @@ | ||
# External File Storage Module for Business Central | ||
Provides an API that lets you connect external cloud storage accounts to Business Central, allowing users to access files stored outside of Business Central. | ||
|
||
## Main Components | ||
|
||
### File Account | ||
A file account holds the information needed to access an external storage service from Business Central. |
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,70 @@ | ||
{ | ||
"id": "c9c54414-80c3-4cc9-98c6-589158882774", | ||
"name": "External File Storage", | ||
"publisher": "Microsoft", | ||
"brief": "Access external file storage services", | ||
"description": "Enables access to external file storage services from Business Central.", | ||
"version": "26.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=2103698", | ||
"url": "https://go.microsoft.com/fwlink/?linkid=724011", | ||
"logo": "", | ||
"dependencies": [ | ||
{ | ||
"id": "7e3b999e-1182-45d2-8b82-d5127ddba9b2", | ||
"name": "DotNet Aliases", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
}, | ||
{ | ||
"id": "872fe7e8-9893-40ae-ab94-c123ed30fdbd", | ||
"name": "Extension Management", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
}, | ||
{ | ||
"id": "de35f591-7216-4e60-8be1-1911d71a7fc2", | ||
"name": "Telemetry", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
}, | ||
{ | ||
"id": "0846d207-5dec-4c1b-afd8-6a25e1e14b9d", | ||
"name": "Base64 Convert", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
}, | ||
{ | ||
"id": "a4584a53-9345-458a-af20-d1df2fab7bd8", | ||
"name": "Confirm Management", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
}, | ||
{ | ||
"id": "e31ad830-3d46-472e-afeb-1d3d35247943", | ||
"name": "BLOB Storage", | ||
"publisher": "Microsoft", | ||
"version": "26.0.0.0" | ||
} | ||
], | ||
"internalsVisibleTo": [ | ||
{ | ||
"id": "f188754b-3ffb-443a-9507-f5fbdae3af2c", | ||
"name": "External File Storage Test Library", | ||
"publisher": "Microsoft" | ||
} | ||
], | ||
"screenshots": [ | ||
|
||
], | ||
"platform": "26.0.0.0", | ||
"idRanges": [ | ||
{ | ||
"from": 9450, | ||
"to": 9459 | ||
} | ||
], | ||
"target": "OnPrem", | ||
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2134520" | ||
} |
22 changes: 22 additions & 0 deletions
22
...ystem Application/App/External File Storage/permissions/FileStorageAdmin.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,22 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// 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; | ||
|
||
permissionset 9450 "File Storage - Admin" | ||
{ | ||
Access = Public; | ||
Assignable = true; | ||
Caption = 'External File Storage - Admin'; | ||
|
||
IncludedPermissionSets = "File Storage - Edit"; | ||
|
||
Permissions = | ||
tabledata "Ext. File Storage Connector" = RIMD, | ||
tabledata "File Storage Connector Logo" = RIMD, | ||
tabledata "File Account Scenario" = RIMD, | ||
tabledata "File Scenario" = RIMD, | ||
tabledata "File Account Content" = RIMD; | ||
} |
20 changes: 20 additions & 0 deletions
20
...System Application/App/External File Storage/permissions/FileStorageEdit.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,20 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// 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; | ||
|
||
using System.Environment; | ||
|
||
permissionset 9453 "File Storage - Edit" | ||
{ | ||
Access = Public; | ||
Assignable = false; | ||
Caption = 'File Storage - Edit'; | ||
|
||
IncludedPermissionSets = "File Storage - Read"; | ||
|
||
Permissions = tabledata "File Storage Connector Logo" = imd, | ||
tabledata "Tenant Media" = imd; | ||
} |
13 changes: 13 additions & 0 deletions
13
...tem Application/App/External File Storage/permissions/FileStorageObjects.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,13 @@ | ||
namespace System.ExternalFileStorage; | ||
|
||
permissionset 9452 "File Storage - Objects" | ||
{ | ||
Access = Internal; | ||
Assignable = false; | ||
|
||
Permissions = | ||
table "File Account" = X, | ||
table "File Account Content" = X, | ||
table "File Account Scenario" = X, | ||
table "File Scenario" = X; | ||
} |
23 changes: 23 additions & 0 deletions
23
...System Application/App/External File Storage/permissions/FileStorageRead.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,23 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// 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; | ||
|
||
using System.Environment; | ||
|
||
permissionset 9451 "File Storage - Read" | ||
{ | ||
Access = Internal; | ||
Assignable = false; | ||
IncludedPermissionSets = "File Storage - Objects"; | ||
|
||
Permissions = | ||
tabledata "Ext. File Storage Connector" = r, | ||
tabledata "File Storage Connector Logo" = r, | ||
tabledata "File Account Scenario" = r, | ||
tabledata "File Scenario" = r, | ||
tabledata "File Account Content" = r, | ||
tabledata Media = r; // This permission is required by External File Storage Account Wizard | ||
} |
48 changes: 48 additions & 0 deletions
48
src/System Application/App/External File Storage/src/Account/FileAccount.Codeunit.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,48 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// 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; | ||
|
||
/// <summary> | ||
/// Provides functionality to work with file accounts. | ||
/// </summary> | ||
|
||
codeunit 9450 "File Account" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally I think all of these objects should have been called "Storage Account" etc., but the renaming will be extensive, so let's settle for File Account. It's not like it's wrong... |
||
{ | ||
Access = Public; | ||
InherentPermissions = X; | ||
InherentEntitlements = X; | ||
|
||
/// <summary> | ||
/// Gets all of the file accounts registered in Business Central. | ||
/// </summary> | ||
/// <param name="LoadLogos">Flag, used to determine whether to load the logos for the accounts.</param> | ||
/// <param name="TempFileAccount">Out parameter holding the file accounts.</param> | ||
procedure GetAllAccounts(LoadLogos: Boolean; var TempFileAccount: Record "File Account" temporary) | ||
begin | ||
FileAccountImpl.GetAllAccounts(LoadLogos, TempFileAccount); | ||
end; | ||
|
||
/// <summary> | ||
/// Gets all of the file accounts registered in Business Central. | ||
/// </summary> | ||
/// <param name="TempFileAccount">Out parameter holding the file accounts.</param> | ||
procedure GetAllAccounts(var TempFileAccount: Record "File Account" temporary) | ||
begin | ||
FileAccountImpl.GetAllAccounts(false, TempFileAccount); | ||
end; | ||
|
||
/// <summary> | ||
/// Checks if there is at least one file account registered in Business Central. | ||
/// </summary> | ||
/// <returns>True if there is any account registered in the system, otherwise - false.</returns> | ||
procedure IsAnyAccountRegistered(): Boolean | ||
begin | ||
exit(FileAccountImpl.IsAnyAccountRegistered()); | ||
end; | ||
|
||
var | ||
FileAccountImpl: Codeunit "File Account Impl."; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/System Application/App/External File Storage/src/Account/FileAccount.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,43 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// 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; | ||
|
||
/// <summary> | ||
/// A common representation of a file account. | ||
/// </summary> | ||
table 9450 "File Account" | ||
{ | ||
Extensible = false; | ||
TableType = Temporary; | ||
|
||
fields | ||
{ | ||
field(1; "Account Id"; Guid) { } | ||
field(2; Name; Text[250]) { } | ||
field(4; Connector; Enum "Ext. File Storage Connector") { } | ||
field(5; Logo; Media) | ||
{ | ||
Access = Internal; | ||
} | ||
} | ||
|
||
keys | ||
{ | ||
key(PK; "Account Id", Connector) | ||
{ | ||
Clustered = true; | ||
} | ||
key(Name; Name) | ||
{ | ||
Description = 'Used for sorting'; | ||
} | ||
} | ||
|
||
fieldgroups | ||
{ | ||
fieldgroup(Brick; Logo, Name) { } | ||
} | ||
} |
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.
Add the following codeunits here and remove their inherent entitlement/permissions.
"External File Storage"
"File Account"
"File Pagination Data"
"File Scenario"
Reason for this is because they're the facade layers and should still be controlled via permissions.
The
File Storage
permission sets also need to be added to the following, otherwise we will get permission issues when we get a SaaS deployment.The
"File Storage - Read"
should be added tosrc/System Application/App/Permissions/SystemApplicationRead.PermissionSet.al
The
"File Storage - Edit"
should be added tosrc/System Application/App/Permissions/SystemApplicationEdit.PermissionSet.al
The
"File Storage - View"
should be added tosrc/System Application/App/Permissions/SystemApplicationView.PermissionSet.al
The
"File Storage - Objects"
should be added tosrc/System Application/App/Permissions/SystemApplicationObjects.PermissionSet.al
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.
@darjoo while you're looking at permissions.
What about entitlements.
a delegated admin has the entitlement for e-mail admin.
Wouldn't it be logical to add the
File Storage Admin
there, too?https://github.com/microsoft/BCApps/blob/main/src/System%20Application/App/Entitlements/DelegatedAdminagentPartner.Entitlement.al