Add folders with password sharing and email invites

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 22:30:00 +03:00
parent a375ad330a
commit db2cef41bb
16 changed files with 1016 additions and 4 deletions
+11 -1
View File
@@ -3,6 +3,9 @@ from functools import wraps
from flask import abort, flash, redirect, url_for
from flask_login import current_user
from app.folder_utils import can_edit_folder, is_folder_owner
from app.models import FolderMember
def admin_required(f):
@wraps(f)
@@ -20,7 +23,14 @@ def can_manage_photo(photo):
return False
if current_user.is_admin:
return True
return photo.user_id == current_user.id
if photo.user_id == current_user.id:
return True
if photo.folder_id and photo.folder:
if is_folder_owner(photo.folder, current_user):
return True
if can_edit_folder(photo.folder, current_user):
return True
return False
def photo_owner_or_admin(photo):