LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File permissions - same old story

Solved!
Go to solution

Are you referring to my SetFileSecurityAccess-Windows-dotNET.vi?

It is called SET file security access, not "clear" file security access. So technically it is fully working, you just want it to do something else.

 

Did you try changing the "AddAccessRule" node to "RemoveAccessRule"? I haven't tried it but it seems logical.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 11 of 13
(1,745 Views)

Did you try changing the "AddAccessRule" node to "RemoveAccessRule"? I haven't tried it but it seems logical.


I did, but it doesn't work either.

0 Kudos
Message 12 of 13
(1,723 Views)

Well I just tried it and it worked.

I created a new user access rule on a file for the "Guests" user to have full control.

Then I modified the SetFileSecurityAccess VI as below, ran it, and the security access was cleared.

RemoveAccessRule.png

Notice I did this using what I knew to be the username rather than looking up the username from the SID. It simplifies the VI but makes it harder to use if you don't know the username.

 

See security tab for file before and after.

ClearAccessRights.png

 

This is just an educated guess but two things may be preventing a change to security access rules (excluding admin rights):

You may need to remove "inheritance" from the file properties if it is inheriting the access rule from it's parent folder.

The file system itself may be preventing a change if clearing access rules results in nobody having access rights.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 13 of 13
(1,710 Views)