unable to set permission read and write to volumes directory in macos 10.15

29 views Asked by At

i wanted to set the read and write permission to volumes directory i have tried with apple script. its adding that user in ACL but permission getting set to custom. if i use chown its sets the permission to read and write but i don't want to change ownership of that directory just wanted to add user to that directory with read and write access here is my code

code with chown 

set userName to "test"
set folderPath to "/Volumes/"
set scriptName to "/Users/test/Desktop/mk.sh"
do shell script "chown  " & quoted form of userName & " " & quoted form of folderPath with administrator privileges
do shell script scriptName

In this above i am able to set permission read and write but its changing owner from system to test i don't want to change owner

code with chmod

set userName to "test"
set folderPath to "/Volumes/"
set scriptName to "/Users/test/Desktop/mk.sh"
do shell script "chmod -R +a \"" & userName & " allow read,write\" " & quoted form of folderPath with administrator privileges
do shell script scriptName

After running code which chmod its add user to ACL but unable to set permission read and write its sets to customenter image description here

i wanted to set read and write access to user "test" without changing the ownership of that particular directory.

0

There are 0 answers