2

I want to automate the 'Granting Access Permission to a file/folder to a specific user' using python. Please help me which command i need to use.

Thanks in advance.

Regards, KVJ

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Possible duplicate of [How to change the user and group permissions for a directory, by name?](https://stackoverflow.com/questions/5994840/how-to-change-the-user-and-group-permissions-for-a-directory-by-name) – sarthak Jan 08 '18 at 09:06

1 Answers1

0

You can use the following to change permissions on a UNIX platform.

import subprocess
import shlex

subprocess.call(shlex.split("chgrp -R groupname foldername"))

The -R flag changes the group permissions recursively for a given folder.

kdheepak
  • 1,274
  • 11
  • 22