From dc1a0f6fddea4c5477b51664102b7ac6ddce5bcc Mon Sep 17 00:00:00 2001 From: Naser Asadi <55012879+NaserAsadi727@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:51:57 +0330 Subject: [PATCH 1/2] Update file.md Added missing security requirement for the SecureFile --- how-to/filesAndImages/file.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/how-to/filesAndImages/file.md b/how-to/filesAndImages/file.md index bffbdfd..d068577 100644 --- a/how-to/filesAndImages/file.md +++ b/how-to/filesAndImages/file.md @@ -148,6 +148,7 @@ public partial class TestResult : GuidEntity There are multiple things to note: - `Blob` is an M# type to represent binary data (blob stands for binary large object) +- As you see in the comment above the generated property for `blob`, you should add a method in the entitiy's logic for `IsDataVisibleTo(IUser)` for specifying all the users that are allowed to access the file. If you want to anable it for all users, just return `true` in the method. - The file uses a backing field and the property unlike other properties which don't have any backing fields - `ValidateProperties()` checks to see if the file has any unsafe extensions. That's for security reasons to not allow the user to upload files which can compromise the server. -- The `Clone()` method clones the file separately and stores the reference of the cloned file in the cloned object because cloning the original object will not clone it deeply with all of the referenced classes in its fields (to learn more see [this](https://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy)). \ No newline at end of file +- The `Clone()` method clones the file separately and stores the reference of the cloned file in the cloned object because cloning the original object will not clone it deeply with all of the referenced classes in its fields (to learn more see [this](https://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy)). From 3a577c66f96d6c1339f73541df6ffb28b2668b82 Mon Sep 17 00:00:00 2001 From: Naser Asadi <55012879+NaserAsadi727@users.noreply.github.com> Date: Fri, 24 Mar 2023 16:00:57 +0330 Subject: [PATCH 2/2] Update file.md --- how-to/filesAndImages/file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/how-to/filesAndImages/file.md b/how-to/filesAndImages/file.md index d068577..f7d4b61 100644 --- a/how-to/filesAndImages/file.md +++ b/how-to/filesAndImages/file.md @@ -148,7 +148,7 @@ public partial class TestResult : GuidEntity There are multiple things to note: - `Blob` is an M# type to represent binary data (blob stands for binary large object) -- As you see in the comment above the generated property for `blob`, you should add a method in the entitiy's logic for `IsDataVisibleTo(IUser)` for specifying all the users that are allowed to access the file. If you want to anable it for all users, just return `true` in the method. +- As you see in the comment above the generated property for `blob`, you should add a method in the entitiy's logic for `IsDataVisibleTo(IUser)` for specifying all the users that are allowed to access the file. If you want to enable it for all users, just return `true` in the method. - The file uses a backing field and the property unlike other properties which don't have any backing fields - `ValidateProperties()` checks to see if the file has any unsafe extensions. That's for security reasons to not allow the user to upload files which can compromise the server. - The `Clone()` method clones the file separately and stores the reference of the cloned file in the cloned object because cloning the original object will not clone it deeply with all of the referenced classes in its fields (to learn more see [this](https://stackoverflow.com/questions/184710/what-is-the-difference-between-a-deep-copy-and-a-shallow-copy)).