0

I am trying to just find files where the shared_link permissions are False.

file1 = user_client.file(file_id).get()

shared_link =file1.shared_link
permissions = shared_link.permissions


if permissions == False:
    print(f'File "{file1.name}" is not downloadable')
else:
    pass

I expected "This file is not downloadable." but get this:

Exception has occurred: AttributeError
'dict' object has no attribute 'permissions'
File "/Users/ianhorn/Documents/Box-Reports/can_download.py", line 38, in \<module\>
permissions = shared_link.permissions
AttributeError: 'dict' object has no attribute 'permissions'
Ian Horn
  • 27
  • 4

1 Answers1

0

You can get this variable by debugging the script. In variables, you will toggle open the shared_link variable, then function variables.

The answer is data.shared_link['permissions']['can_download'].

debug scritp

Ian Horn
  • 27
  • 4