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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user