Related File Permission To Execute The Application - matlab

I accomplished writing an application code in Matlab. I create a .mat file and save data into it somewhere in the code. I converted it to a standalone application file.(exe) However, I don't want to give permission to the user to see and modify this .mat file because the application uses that file in the next executions. For this reason, I changed the permission settings by right clicking the folder and:
properties-Security-Advanced-Changed Permission
However, after changing the permission, the code cannot reach that file and fails while executing. How can I handle it?

To my opinion you are approaching this the wong way. To make that concept working, your application would require higher permissions than the user has, especially the user may not modify permissions. For the majority of self-administrated PCs this is impossible, because the primary user has full administrative rights, allowing to modify folder permissions.
For such cases the typical solution is encryption. Assume everyone can access your files, store only encrypted files to the hard drive.

Related

Access to folders goes away when restarting the app

My app needs access to certain folders and the contents of them (that the user picks) outside of the sandbox. I have that working well and all, however when the app restarts, I can still see what’s inside the folder, but I can’t read the files inside the folder.
I’m getting access to the folder through a simple NSOpenPanel, which like I said, works and gives me access to all files and subfolders until the app is restarted.
Is there any way I can make it so the NSOpenPanel grants me permanent access to the files?
The permission has been revert back to its original condition when restarted , you might want to check again the implementation of the folder access to be granted automatically

How to share OneDrive files using Powershell?

I'd like to find an automatic way to share OneDrive files with a specific internal user, what's the best approach? My current scripts are using PowerShell, but that's not a hard requirement.
I've tried:
https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-1.0 - what's the best library to use for this? I've created an AzureAD app with the appropriate delegated permissions. In PowerShell, once I run Connect-MgGraph, what method can I run to call this?
https://learn.microsoft.com/en-us/powershell/module/sharepoint-pnp/set-pnplistitempermission?view=sharepoint-ps - but my OneDrive items aren't part of a list. Could they be? The folder permission works well: https://learn.microsoft.com/en-us/powershell/module/sharepoint-pnp/set-pnpfolderpermission but I don't understand why there isn't a file one just like this folder one
I know the absolute URL of the file, the UPN of the internal user I want to directly share with, and I have owner permissions to the file. How can I do this?

Save PDF file to a user-defined default directory in iCloud Drive

I'm asking this question because I did not find any answer, and I'm starting to believe that it's not possible, due to security reasons. But who knows?
In my app, I simply let the user save a PDF file using UIActivityViewController. The user then chooses Save to file, then selects iCloud Drive.
Now, users ask me to be able to select a default location once and for all.
Is it possible? This location would of course be outside the app container, then I suppose iOS won't grant access unless the user selected it itself.
Yes you can. Using UIDocumentPickerViewController you can ask for a directory, and you can save it in your app. This is explained in detail in Providing Access to Directories. iOS 13 and later.
See also What's New in File Management and Quick Look for sample code saving a directory URL and then reusing it to set the base directory for a subsequent call to UIDocumentPickerViewController

Filemaker 11 Perform Script in another file

I want to run a script in one file (A) from another file (B). In file B I have a script step: Perform Script [“email test” from file:”A”]
File A is password protected, so when the script runs a login dialog box comes up, but I want this to run automatically in the background without having to enter a password. File B is a timed file? How do I do this?
Add the same username and password in File A as File B.
Then in File A goto File -> File Options and tick Log in using and fill in the credentials.
File A will open without asking for a username/password and when it opens File B to call the script it will pass on the authentication details.
Offhand I can think of three techniques you can use to run the script in File A without needing to enter the password each time.
First, on the Mac there is the option to "Remember my password" when you log into File A. If you check this, FileMaker will look up the password when File B performs the script in File A and should automatically log in. I don't know if such a feature exists in Windows but it might be possible to do the same thing there.
Second, once a user is authenticated with FileMaker, FileMaker will try to use the same authentication credentials for any other database that the first database tries to open. So, as Adam suggests, you can add the same Username and Password used in File A to the Security section of File B. From there you would change the File Options to auto-login with the Username and Password you transferred. You should now automatically log in to both File B and File A.
Third, you could manually log into File A and just leave it open. This technique isn't as robust as the first two as you would need to manually log in again each time the file shuts down or connectivity is lost.
A Few Words About Security
File A probably has a password for a reason. When doing techniques like this it is certainly best to think about security and what people should be allowed to access if they gain access to your computer. At minimum your computer should probably require a password both at login and whenever the screensaver is deactivated just to ensure that people without authorization aren't able to access File A when they shouldn't.
Remember that, with the second technique, anyone who gains access to File B can now access File A with your credentials so you definitely want to be careful with File Sharing and letting others use your computer.

Prevent Save As Functionality

I need to prevent a document from being saved / saved as (say from ms word). I've looked around and I havn't quite found a satifying answer. I've considered EFS... but I don't think it prevents the user from saving the document as... (though it prevents access to the original source file). Any ideas outthere?
Run it on completely locked-down system with read-only disk, no network and no removable drives. Access to the computer must be phisically restricted as well.
This should prevent Save As from working, but still won't prevent document from being copied (someone may take photo of the screen and OCR it).
It usually isn't worth it to disable Save As, because you need access to the original in order to open it in the first place. There are always ways to copy a file.
I had the same issue come up when someone asked me to disable Save As for a PDF.
There is no way take an arbitrary document and modify it in such a way that it cannot be saved. You could modify a program such as Word not to allow Save or Save As but that would still allow someone to open and save the document with a different program or on a different machine.