Page 1 of 1

File Permission

Posted: Tue Dec 06, 2005 5:49 pm
by arcanjo_junior
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 ?

Thanks.
<@rCANJ0>

Posted: Tue Dec 06, 2005 6:17 pm
by madshi
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.