Defines the access levels for collaborators. This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. :ivar sharing.AccessLevel.owner: The collaborator is
| 71 | AccessInheritance_validator = bv.Union(AccessInheritance) |
| 72 | |
| 73 | class AccessLevel(bb.Union): |
| 74 | """ |
| 75 | Defines the access levels for collaborators. |
| 76 | |
| 77 | This class acts as a tagged union. Only one of the ``is_*`` methods will |
| 78 | return true. To get the associated value of a tag (if one exists), use the |
| 79 | corresponding ``get_*`` method. |
| 80 | |
| 81 | :ivar sharing.AccessLevel.owner: The collaborator is the owner of the shared |
| 82 | folder. Owners can view and edit the shared folder as well as set the |
| 83 | folder's policies using |
| 84 | :meth:`dropbox.dropbox_client.Dropbox.sharing_update_folder_policy`. |
| 85 | :ivar sharing.AccessLevel.editor: The collaborator can both view and edit |
| 86 | the shared folder. |
| 87 | :ivar sharing.AccessLevel.viewer: The collaborator can only view the shared |
| 88 | folder. |
| 89 | :ivar sharing.AccessLevel.viewer_no_comment: The collaborator can only view |
| 90 | the shared folder and does not have any access to comments. |
| 91 | :ivar sharing.AccessLevel.traverse: The collaborator can only view the |
| 92 | shared folder that they have access to. |
| 93 | :ivar sharing.AccessLevel.no_access: If there is a Righteous Link on the |
| 94 | folder which grants access and the user has visited such link, they are |
| 95 | allowed to perform certain action (i.e. add themselves to the folder) |
| 96 | via the link access even though the user themselves are not a member on |
| 97 | the shared folder yet. |
| 98 | """ |
| 99 | |
| 100 | _catch_all = 'other' |
| 101 | # Attribute is overwritten below the class definition |
| 102 | owner = None |
| 103 | # Attribute is overwritten below the class definition |
| 104 | editor = None |
| 105 | # Attribute is overwritten below the class definition |
| 106 | viewer = None |
| 107 | # Attribute is overwritten below the class definition |
| 108 | viewer_no_comment = None |
| 109 | # Attribute is overwritten below the class definition |
| 110 | traverse = None |
| 111 | # Attribute is overwritten below the class definition |
| 112 | no_access = None |
| 113 | # Attribute is overwritten below the class definition |
| 114 | other = None |
| 115 | |
| 116 | def is_owner(self): |
| 117 | """ |
| 118 | Check if the union tag is ``owner``. |
| 119 | |
| 120 | :rtype: bool |
| 121 | """ |
| 122 | return self._tag == 'owner' |
| 123 | |
| 124 | def is_editor(self): |
| 125 | """ |
| 126 | Check if the union tag is ``editor``. |
| 127 | |
| 128 | :rtype: bool |
| 129 | """ |
| 130 | return self._tag == 'editor' |