user299404
user299404

Reputation: 51

Google Drive API Folder Permission

If I give a folder permission, is it possible to not cascade down that permission to subfolders? Here is a folder structure

Folder A
Folder A\Folder B
Folder A\Folder C

If I give Folder A permission, I dont want to give folder B and Folder C permission.

When I insert permission to folderid, it also give anything under it that permission.

Upvotes: 0

Views: 989

Answers (2)

cubecubed
cubecubed

Reputation: 238

Just give A the permissions you want it to have. Then give B and C the permission you want it to have.

       A - Permission 1                    B - Permission 2      C - Permission 2
B | Permission 1  C | Permission 1

Result

       A Permission 1
B Permission 2 C Permission 2

KEY

- = Set the permission to
| = The permission is inherited

Upvotes: 0

Zig Mandel
Zig Mandel

Reputation: 19835

Yes what you see is the current behavior. Once you give permission for user U to folder A you need to loop through the children folders and remove U from their permissions. Gets tricky if some children already had such permission so you need to load their permissions before changing A and compare.

Upvotes: 1

Related Questions