Skip to content

Commit

Permalink
Merge pull request #9 from seatable/fix-custom-share-perm
Browse files Browse the repository at this point in the history
fix custom share perm
  • Loading branch information
freeplant authored Jun 4, 2021
2 parents c91758b + 2a528a4 commit 96d68cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN rm -f /usr/bin/python && \
ln -s /usr/local/bin/pip3.6 /usr/bin/pip && \
ln -s /usr/local/bin/pip3.6 /usr/bin/pip3

RUN pip3 install uvicorn pillow pymysql sqlalchemy future requests \
RUN pip3 install uvicorn pillow sqlalchemy==1.4.6 pymysql future requests \
-i https://mirrors.aliyun.com/pypi/simple && rm -r /root/.cache/pip


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
uvicorn
pillow
sqlalchemy==1.4.6
pymysql
sqlalchemy
future # seaf-server
requests

Expand Down
9 changes: 5 additions & 4 deletions seatable_thumbnail/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ def check(self):
def has_dtable_asset_read_permission(self):
# three ways to access asset
# 1. through external link to get image
# 2. through dtable perm, including dtable share
# 3. through view share perm
# 2. through collection table to get image
# 3. through dtable perm, including dtable share, dtable custom share
# 4. through view share perm

if self.can_access_image_through_external_link():
return True
if self.has_collection_table_permission():
return True
if 'r' in self.check_dtable_permission():
if self.check_dtable_permission():
return True
if 'r' in self.get_view_share_permission():
if self.get_view_share_permission():
return True

return False
Expand Down

0 comments on commit 96d68cd

Please sign in to comment.