File Permission

delphi package - easy access to security apis

File Permission

Postby arcanjo_junior » Tue Dec 06, 2005 5:49 pm

Hi, I would like know if is possible change a file permission using madSecurity.
My problem is : I have one file and I cannot change the file using a limited user. If I use madSecurity I can set permission for read/write this file ? If yes, You can send a simple example ?

Posts: 46
Joined: Sun Oct 09, 2005 1:06 am

Postby madshi » Tue Dec 06, 2005 6:17 pm

You can do that, but you need to have enough access rights to the file to change security settings. You can try e.g. "FileSecurity(filePath).DAcl.SetFileAccess(CurrentUser, true)" to give the current user full access rights. If that doesn't work, you can try "FileSecurity(filePath).Owner := CurrentUser" and then the first code again.
Site Admin
Posts: 9591
Joined: Sun Mar 21, 2004 5:25 pm

Return to madSecurity

Who is online

Users browsing this forum: No registered users and 1 guest