Skip to content

Commit

Permalink
Merge pull request #10 from seatable/fix-collection-table-perm
Browse files Browse the repository at this point in the history
fix collection table perm
  • Loading branch information
freeplant authored Jun 28, 2021
2 parents 96d68cd + 1cbf105 commit abf63cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions seatable_thumbnail/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def has_dtable_asset_read_permission(self):
def can_access_image_through_external_link(self):
if not hasattr(self, 'external_link'):
return False
if not self.external_link.get('dtable_uuid'):
return False

return self.external_link['dtable_uuid'] == self.dtable_uuid

Expand Down Expand Up @@ -143,6 +145,10 @@ def is_group_member(self, group_id, email, in_structure=None):
def has_collection_table_permission(self):
if not hasattr(self, 'collection_table'):
return False
if not self.collection_table.get('token'):
return False
if not self.collection_table.get('dtable_uuid'):
return False

token = self.collection_table['token']
obj = self.db_session.query(
Expand Down

0 comments on commit abf63cd

Please sign in to comment.