Add guest mode functionality for read-only access

- Implement guest mode for unauthenticated users
- Allow file viewing and downloading without login
- Hide create/edit/delete functions for guests
- Add guest mode banner with login prompt
- Add read-only badges for guest accessible files
- Include permission checks for all CRUD operations
- Add responsive guest mode styling
- Support both online (Supabase) and offline (localStorage) modes

Features:
• Guest users can view all files and download attachments
• Authentication required for create, edit, delete operations
• Seamless transition between guest and authenticated modes
• User-friendly guest experience with clear login prompts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-19 14:02:13 +09:00
parent ac506321e8
commit 7bae9abe28
4 changed files with 164 additions and 8 deletions

View File

@@ -100,14 +100,19 @@ const SupabaseHelper = {
async getFiles(userId) {
if (!supabase) throw new Error('Supabase가 초기화되지 않았습니다.');
const { data, error } = await supabase
let query = supabase
.from('files')
.select(`
*,
file_attachments (*)
`)
.eq('user_id', userId)
.order('created_at', { ascending: false });
`);
// 공개 파일 요청이 아닌 경우에만 사용자 ID로 필터링
if (userId !== 'public') {
query = query.eq('user_id', userId);
}
const { data, error } = await query.order('created_at', { ascending: false });
if (error) throw error;
return data;